awesome/spec/wibox
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
..
container Add tests for get_children of containers 2017-06-08 17:00:44 +02:00
layout wibox.layout.flex: Do not leave empty space behind 2018-11-05 10:13:18 +01:00
widget add busted tests for signal "property::value" 2018-04-24 00:24:06 +02:00
hierarchy_spec.lua wibox.hierarchy: Only count "really visible" widgets 2017-03-11 18:44:56 +01:00
test_utils.lua Add tests for get_children of containers 2017-06-08 17:00:44 +02:00