Commit Graph

3576 Commits

Author SHA1 Message Date
mergify[bot] a4572b9b52
Merge pull request #3238 from ShayAgros/master
Fixed wrong handling of negative spacing in layout.fixed
2021-04-29 06:45:50 +00:00
mergify[bot] 4c46f6dbf3
Merge pull request #3335 from Elv13/imagebox
Extend wibox.widget.imagebox to encompass the required wallpaper API features
2021-04-28 18:39:03 +00:00
Emmanuel Lepage Vallee 5cfcbac959 imagebox: Extend to add enough knobs for the wallpaper API.
* horizontal/vertical scaling/stretch
 * max scaling factor
 * vertical/horizontal align instead of hardcoded top-left
 * scaling_quality, if Cairo cooperates

It also fixes the clip_shape when resize = false.
2021-04-28 00:06:08 -07:00
mergify[bot] 42d241c707
Merge pull request #3332 from Elv13/tile_container2
Tile container
2021-04-26 11:37:20 +00:00
actionless 5bd0ff82a6 fix(wibox: textbox): remove ldoc tags added by merge mistake 2021-04-25 20:55:44 +02:00
Emmanuel Lepage Vallee ee0d793efe doc: Document the place container. 2021-04-24 23:28:18 -07:00
Emmanuel Lepage Vallee 738e2e0467 container: Add a tile container.
It will be used for the new awful.wallpaper module. The idea is to
first close the gap with `gears.wallpaper` before it gets deprecated.
2021-04-24 23:28:18 -07:00
Emmanuel Lepage Vallee d373bf2d05 widget: Emit "property::widget"
For consistency.
2021-04-24 23:28:18 -07:00
Emmanuel Lepage Vallee 78b8756068 place: Split internal logic to be reusable.
This will become the base class of a new "tile" container.

I also fixed a bug which could cause the output to be blurry for
some widget sizes.
2021-04-24 23:28:18 -07:00
Emmanuel Lepage Vallee 6a4e555ae1 slider: Fix an aliasing issue.
There was a bunch of `math.floor` missing. Some slider size were blurry.
2021-04-24 23:28:18 -07:00
actionless 6b93661048 fix(awful: hotkeys_popup: insert_keys): handle case when user actually binded some key like `<` or `>` which require xml escape for pango 2021-04-23 07:52:17 +02:00
Yauhen Kirylau a35acea61a
Merge branch 'master' into hotkeys-popup-better-split-key-labels 2021-04-23 07:23:26 +02:00
Aire-One 6226742f72 doc(wibox.widget.textclock): Widget definition. 2021-04-07 01:38:53 -07:00
Aire-One b184f95195 doc(layout.flex): Hide `fill_space` property doc
Add an explicite `@property` tag to the `wibox.layout.flex` doc
comments to override the `fill_space` property from
`wibox.layout.fixed` and mark it as hidden thanks to `@hidden`.
2021-04-02 20:02:39 +02:00
Emmanuel Lepage Vallee 90c4c60d2a Add more @supermodule and @hidden 2021-04-02 19:24:07 +02:00
Aire-One 0ae0add45f doc(imagebox): Fix @method tags 2021-04-02 19:24:07 +02:00
Aire-One b706aa9bd0 doc(@hidden): Add to wibox.widget.base module 2021-04-02 19:24:07 +02:00
Aire-One 20a8d902c5 doc(@supermodule): Add to awful.widget modules 2021-04-02 19:24:07 +02:00
Aire-One 3969ad8819 doc(@supermodule): Add to wibox.layout modules 2021-04-02 19:24:07 +02:00
Aire-One 3b12a8d19a doc(@supermodule): Add to wibox.container modules 2021-04-02 19:24:07 +02:00
Aire-One 3ed2fc8500 doc(@supermodule): Add to wibox.widget modules 2021-04-02 19:24:07 +02:00
Aire-One 12662d4cb1 doc(@supermodule): wibox.widget.base doc 2021-04-02 19:24:07 +02:00
Aire-One 3a6fa10754 doc(@supermodule): gears.object inheritable doc 2021-04-02 19:24:07 +02:00
mergify[bot] 7a8fa9d27a
Merge pull request #3294 from sclu1034/feature/count_keys
Add utility to count table keys
2021-04-01 07:42:25 +00:00
Lucas Schwiderski f68939bfc1
chore(g.table): Add missing modeline 2021-03-31 08:29:00 +02:00
Lucas Schwiderski ec3788bf73
docs(g.table): Improve parameter descriptions 2021-03-31 08:27:08 +02:00
mergify[bot] 95558ac919
Merge pull request #3297 from actionless/dont-crash-when-gtk4-installed
fix(beautiful: gtk): don't crash when both gtk3 and gtk4 are installed
2021-03-29 15:49:37 +00:00
Emmanuel Lepage Vallée 13e8408562
Merge pull request #3284 from sclu1034/issue/3213
Fix composite widgets with top level container
2021-03-28 16:00:16 -07:00
Emmanuel Lepage Vallee c48e138b01 doc: Add examples for the graph. 2021-03-28 02:37:25 -07:00
Yauhen Kirylau 6ef3a8f059
fix(gears: colors: recolor_image): always duplicate the surface (#3233) 2021-03-27 23:48:48 -07:00
Lucas Schwiderski e7d55567a6
Remove redundant assignment
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-27 14:08:47 +01:00
Shay Agroskin 62850476d2 layout/fixed: Prevent overloading widgets with negative spacing
For each widget, the layout function checks whether placing it would
make the function exceed the allowed geometry.
If not, the function places both the widget and a spacing widget.
This check ignores the size of the spacing widget itself, this can cause
overloading of widgets on top of each other.

For example, the following scenario with these widgets:
    widgets: widget1 { width = 10, height = 10  }
	     widget2 { width = 10, height = 10  }
	     widget3 { width = 10, height = 10  }
and a call to horizontal layout with the
{ width = 10, height = 10, spacing = -5 } parameters.

The function would layout the widgets the following way:
{
    widget1: { x = 0, y = 0, width = 10, height = 10 }
    spacing: { x = 5, y = 0, width = 5, height = 10  }
    widget2: { x = 5, y = 0, width = 5, height = 10  }
    spacing: { x = 5, y = 0, width = 5, height = 10 }
    widget3: { x = 5, y = 0, width = 5, height = 10  }
}

This behaviour would be the same for any number of widgets for negative
layout.

This patch changes the layout function to check whether the current
widget uses up the whole space.
It also removes 'pos' variable. Its purpose isn't intuitive in the
presence of x and y. This helps to understand where each widget is
placed now that x, y don't hold the end location of the widget in the
previous loop iteration.

The result of the previous example becomes:
{
    widget1: { x = 0, y = 0, width = 10, height = 10 }
}

While this might not be the wanted behaviour exactly, distinguishing
between the scenario where 2 widgets are drawn and a scenario where 3
are drawn might complicate the layout function too much.

This patch also adds unit testing that catches the described behaviour.

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
2021-03-26 16:11:01 +03:00
Shay Agroskin a18e3508f6 layout/fixed: Fix wrong space calculation in fit
The fit function is called twice in row.

- The first time it gets the maximum available width, and returns how
  much of it it needs (with 0 spacing it would be 477)

- The second time the available width it gets is the same as it returned
  last phase (and probably is expected to return the same result again)

The width fit requests is the total width of all widgets together + the
spacing (e.g. if each tag widget is 53 px and spacing is -10 then the
requested width 53 * 9 - 80).

The function tries to first fit all its widgets (the tag numbers) in the
amount of width it received, and only then adds the spacing to it. This
is problematic because in the second phase the widgets need to fit
themselves in the same width they requested earlier minus the spacing
(in case of negative spacing). This is of course impossible and so some
widgets are just not being drawn correctly.

This patch makes fit function take into account the spacing while
placing the widgets and not afterwards.

Also add unit-testing that test the bug described.

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
2021-03-26 16:11:01 +03:00
Shay Agroskin 749422100e layout/fixed: Remove code duplication
The function has several expressions of the form
    if self._private.dir == "y" then
This patch stores the result of
    self._private.dir == "y"
to avoid code duplication.

Also remove the 'used_in_dir' and 'in_dir' variables since their values
can be calculated using other variables in the function and updating
them individually is error prone.

This patch doesn't do any functional changes.

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
2021-03-26 16:11:01 +03:00
actionless e833da0303 fix(beautiful: gtk): don't crash when both gtk3 and gtk4 are installed 2021-03-25 00:21:04 +01:00
James R aeb2d85dad
tasklist: Fix documented function names (#3276) 2021-03-22 15:28:53 -07:00
Lucas Schwiderski afced71a9a
Add example for gears.table.count_keys
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:55:40 +01:00
Lucas Schwiderski 058190a3c0
Add missing modelines
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:24:56 +01:00
Lucas Schwiderski 07df24f7d0
Add utility to count table keys
See #3293.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 20:24:55 +01:00
Emmanuel Lepage Vallée d583129eb6
Merge pull request #3143 from Elv13/doc_client_layout
Document the client layout properties
2021-03-22 12:10:36 -07:00
Daniel Hahler dab84c2662
fix(doc): gears.table.keys: s/integer keys/integer/ (#3293) 2021-03-22 12:05:17 -07:00
Emmanuel Lepage Vallée 80a7d9e3ee
Merge pull request #3283 from sclu1034/issue/3214
Remove unused first parameter in some constructors
2021-03-22 10:45:18 -07:00
Emmanuel Lepage Vallee b4cf88f4c0 doc: Fix the titlebars widget constructor doc 2021-03-22 00:56:02 -07:00
Emmanuel Lepage Vallee 31fcce436c doc: Add a client border color example. 2021-03-22 00:56:02 -07:00
Emmanuel Lepage Vallee 8f8d0e7bbf doc: Fix a awful.ewmh->awful.permissions rebase issue 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 522d628c2c doc: Complete the widget documentation page.
This adds the `awful.widget` content along with some images.
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 9f50c5e062 doc: Add more tag images. 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallée 1c8b0b924d
`ruled.client` fixes (#3195)
* ruled.client: Fix a regression introduced when append/remove was added.

* ruled.client: Fix an error message grammar.
2021-03-22 00:04:13 -07:00
Emmanuel Lepage Vallée 50fa1b8679
naughty: Correctly notify the client when a notification is dismissed. (#3184)
Fix #3182

Co-authored-by: Uli Schlachter <psychon@znc.in>
2021-03-22 00:03:37 -07:00
Emmanuel Lepage Vallee 42a86efa50 doc: Document some of the `tag` properties. 2021-03-21 23:58:05 -07:00