awesome/spec
Uli Schlachter c80bf6f46e wibox.layout.flex: Do not leave empty space behind
It is not possible to distribute 100px to three widgets equally. The
current version of wibox.layout.flex tries to do that anyway, by giving
each widget 33px and leaving one pixel outside of any widget. Thus, if
the widgets e.g. have a common background, this leads to a one pixel gap
in the background.

This patch changes the flex layout so that the extra pixel is assigned
to some widget instead. It does so by basically keeping a sum of
space_per_item for the widgets that was assigned so far. This sum is
rounded and when this leads to rounding, the corresponding child widget
gets an extra pixel.

More precisely, this tracks a pos as before. Widgets get their position
still assigned based on rounding pos. However, this now also remembers
this rounded position for the next iteration of the loop. This allows to
assign the size of widgets based on the difference between the current
and last rounded position.

(Possibly) fixes: https://github.com/awesomeWM/awesome/issues/2461
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-11-05 10:13:18 +01:00
..
awful tests: Mock capi.keygrabger 2018-07-29 10:45:40 -04:00
gears gears.table.join: Ignore nil arguments (#2440) 2018-10-16 10:17:45 -04:00
menubar Add unit tests for #2152 2018-01-15 23:47:20 +01:00
wibox wibox.layout.flex: Do not leave empty space behind 2018-11-05 10:13:18 +01:00
preload.lua Add awesome.version to globals for tests. Will always show util.deprecate output 2017-03-02 18:15:59 -06:00