Commit Graph

646 Commits

Author SHA1 Message Date
Cauchy Underground c9a7698677 Add a scroll smooth step function 2024-04-06 11:07:51 +02:00
Emmanuel Lepage Vallée 8b1f8958b4
Merge pull request #3746 from Elv13/grid_border
Modernize the `wibox.layout.grid` module and add border support.
2024-03-23 22:50:03 -07:00
Emmanuel Lepage Vallée 2eab55e536 Update lib/wibox/container/border.lua
Co-authored-by: Aire-One <aireone@aireone.xyz>
2023-12-31 15:27:21 -08:00
Emmanuel Lepage Vallee 5ee926d5f1 background: Add a way to scale a background gradient.
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.
2023-12-31 14:57:10 -08:00
Emmanuel Lepage Vallee e82de8edb4 background: Deprecate `bgimage`.
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).
2023-12-31 14:56:18 -08:00
Emmanuel Lepage Vallee dc207d5b49 container: Add a broder container.
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.
2023-12-31 14:54:44 -08:00
Emmanuel Lepage Vallee e23940cc6a imagebox: Expose the "optimal size" properties.
The `textbox` already has the equivalent. This will soon be used
by the new `wibox.container.border` widget.
2023-12-31 14:54:44 -08:00
Emmanuel Lepage Vallee ab121e9ac0 imagebox: Support a CSS file.
Before, the CSS had to be inline. Now that the border container uses
this code, it makes sense to make it more flexible.
2023-12-31 14:54:44 -08:00
Emmanuel Lepage Vallee 5c9ffb8ef3 imagebox: Expose the private SVG handling function.
To be used by `wibox.container.border`, which is a specialized imagebox.
2023-12-31 14:54:44 -08:00
Emmanuel Lepage Vallee ecc20dd0b8 imagebox: Add 3 new fit policies.
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.
2023-12-31 14:54:42 -08:00
Emmanuel Lepage Vallee eddb83fb72 calendar: Add a border width property. 2023-12-31 00:57:07 -08:00
Emmanuel Lepage Vallee 956bd96e94 grid: Apply Awesome v4.2 naming conventions.
* Stop using top level properties for vertical/horizontal
* No abbreviations
* Use height/width instead of size
* Don't use methods where properties can be used
2023-12-31 00:57:07 -08:00
Emmanuel Lepage Vallee f8f5e2c69b grid: Add border support.
This is long overdue. A bit of historical context. The grid API
is losely somewhat based on the old `radical` module, but was
heavily improved by @getzze. That version had row_span and col_span.

This made the way the previous implementation coded the border
incompatible. I spent some time back then trying to bolt it back on,
but the complexity is quite high and never made it work right.

This commit goes in another direction. Rather than draw the border,
it creates a mask where the border should *not* be, then bucket fill
the widget. This is the equivalent of CSS `border-collapse`.

It also support custom borders. This allows dashed lines and partial
borders.

The main use case will be to add border support to the calendar. It
was previously possible to partially do it using custom cell painters,
but was pretty hacky. Now that the calendar will deprecate the custom
painters in favor of `widget_template`s, a more robust alternative was
required.

The drawback of this commit is obviously the added complexity to the
most complex layout. This is why it adds many tests to cover the various
corner cases.
2023-12-31 00:57:07 -08:00
Emmanuel Lepage Vallee 2d5c4b64c5 grid: Add the ability to specify the properties inline.
This is already used in the `wibox.layout.manual` layout. It makes
the widget easier to use. Previously, using the imperative syntax
was necessary for most grids.
2023-12-31 00:56:24 -08:00
David Kosorin ed71b17f1b
Fix slider with minimum value (#3807) 2023-08-12 16:59:15 -07:00
Emily 5077c8381b
wibox.widget.slider: Add a handle cursor property (#3734)
* wibox.widget.slider: Add a handle cursor property
* wibox.widget.slider: Add a beautiful variable for handle_cursor
* wibox.widget.slider: Remove an unneeded or statement
* wibox.widget.slider: Move handle_cursor variable to the function it belongs in
2022-10-31 10:05:13 -07:00
Emmanuel Lepage Vallee 88c65a71dd textbox: Rename `align` to `halign`.
`halign` is used in multiple place in the API. Once upon a time,
Awesome only supported horizontal widgets, but this era has long
passed.

Fix #3640
2022-09-06 16:11:04 -07:00
Emmanuel Lepage Vallee d7f6410e09 textbox: Add 3 properties.
The textbox API reflects the Pango layout API circa 2011, time to
bring this to 2022. This adds:

 * indent
 * justify
 * line_spacing_factor

It doesn't add `spacing` because it doesn't seem to do anything.
It also doesn't add the `is_*` methods to know if the text wraps
or ellipsize. We could, but nobody asked for them. The line spacing
is a feature request from Posix on Discord.
2022-09-06 16:09:26 -07:00
Emmanuel Lepage Vallee 82a5fb6030 doc: Do not document the 16bit max widget size.
As pointed out by @aire-one, it does not provide much value.
2022-08-29 22:54:09 -07:00
Emmanuel Lepage Vallee a18b40e12b wibox.widget.textclock: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 1eda8cdf93 wibox.widget.textbox: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 642fa3b66b wibox.widget.systray: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 5367513609 wibox.widget.slider: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 79496e9acc wibox.widget.separator: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee f9f04866b8 wibox.widget.progressbar: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee e63d867523 wibox.widget.piechart: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 95cd45942a wibox.widget.imagebox: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 8e16dc4412 wibox.widget.graph: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee ff9c89d005 wibox.widget.checkbox: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 1b726985de wibox.widget.calendar: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 1259c3ccc6 wibox.widget.base: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 926f0ff22f wibox.layout.stack: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee d05fc5dc8f wibox.layout.ratio: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee c963b16f90 wibox.layout.grid: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 13b792e42e wibox.layout.flex: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 285a8b23ff wibox.layout.fixed: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 1fa30c3195 wibox.layout.align: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 2e41211772 wibox.container.tile: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 4c06aaab4f wibox.container.scroll: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 1dafd25d93 wibox.container.rotate: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 6c84e83ccf wibox.container.radialprogressbar: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee f0482485fa wibox.container.place: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee bdec7eb516 wibox.container.mirror: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 534c2324ae wibox.container.margin: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 268c66584e wibox.container.constraint: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee d147899f86 wibox.container.background: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 73ec416287 wibox.container.arcchart: Update the property documentation. 2022-08-29 22:49:47 -07:00
Emmanuel Lepage Vallee 4fa957b75d doc: Force all properties to document their default value. 2022-08-29 22:49:46 -07:00
Emmanuel Lepage Vallee 86d1b1c22c doc: Add a mandatory `@noreturn` for functions and methods.
The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
2022-08-29 22:49:45 -07:00
Emmanuel Lepage Vallee 4bd90f0f35 doc: Add documentation linting and fix all issues it found. 2022-08-29 22:48:54 -07:00