-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new border container #3559
Conversation
havent went through the code yet, but description looks nice 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to do a second pass on the border container code latter. It's getting too late for all the math 😅
This is very promising regarding titlebars and borders for clients. I can't wait for the second part of the series!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't look potentially harmful as it's not changing much of stuff, but rather adding it, so i think it's ok to go if it's still passing the CI
This will be used soon by a nice CSS inspired image slicer container/layout. They have a limitation inherited from Cairo of only working on a single axis. This isn't important for 99% of the use case.
To be used by `wibox.container.border`, which is a specialized imagebox.
Before, the CSS had to be inline. Now that the border container uses this code, it makes sense to make it more flexible.
The `textbox` already has the equivalent. This will soon be used by the new `wibox.container.border` widget.
Rather than bloat the `background` container with another 1k lines, a new container is added. The goal is to implement CSS-style slicing for the background images. The container also allows to place generic widgets on each sides and corners of the container. The main use case for this container is to replace the old `awful.titlebar` API with `awful.decoration`. That new module will allow a central client widget to be surrounded by widgets rather than have 4 separate drawing areas. The border container is designed to make complex border+titlebar setup trivial.
It is now handled by the `wibox.container.border`. The current implementation had many unhandled corner case and is less flexible than the new API. Some might argue deprecating the background from a background container is... strange. This is true. However, keeing all use case within the same codebase would make it too large. The `gears.shape` support is incompatible with the border widgets (which are used to implement the background images).
This is a feature request from the chat. Right now, only deprecated hacks allow this to be implemented. This is a valid use case and must be supported for HiDPI use cases.
37a93e6
to
84a9e54
Compare
Co-authored-by: Aire-One <[email protected]>
84a9e54
to
2eab55e
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3559 +/- ##
==========================================
+ Coverage 91.01% 91.22% +0.21%
==========================================
Files 901 927 +26
Lines 57566 59450 +1884
==========================================
+ Hits 52392 54233 +1841
- Misses 5174 5217 +43
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Merging since this was approved and I only rebased/fixed_new_doc_warnings |
This container have 2 main aspect. First, it implement CSS-style slices. So background images stretch properly:
note: Ignore the visible artifacts in the image. It's only in the doc because it places raster images in SVG and rescale them incorrectly when the browser scales the SVG.
The second feature is the ability to have side and corner widgets for the border.
Initially, I didn't plan to finish this for this release, but some people shown interest in the chat. There was also some questions in #3489 about how complex titlebars can be handled without 400 lines of ugly hacks. With this container, you can directly take a background image and end up with this:
This is the first part of a 2 part series to fix #650 (comment) . I will not do the second part before v4.4. The other half is mostly the productionalized version of @psychon code. The new
awful.decoration
module will not really add size/corner resize by default. However, it will now be trivial to add rather than stupidly hard with 2wibox.layout.align
and 2wibox.layout.flex
like it is right now.I thought "it's almost fully implemented, how bad can it be to finish it!": very bad... This container was a corner case rabbit hole. I kind of gave up in December, but finally had the guts to finish it. The DPI property is still not exposed. It will take more rabbit hunting down in the rabbit hole.
About the implementation. I hesitated between putting this in
wibox.layout
orwibox.container
. In the end I picked container because it only have 1 "indexed" widget. This deprecatedwibox.container.background.bgimage
. That's "weird" because it's deprecating the background support for the background container. However, the shape and bgimage were always pretty much incompatible. Extending thebackground
container with all the new properties would have made the code unmaintainable. I added a couple new properties to thebackground
container to compensate for some of the deprecated corner case which could not be handled by the border container.edit: I also fix a few CSS support bugs. I added CSS support in the wallpaper PR serie, but it wasn't that well tested