awesome/lib/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 mirror: Fix documentation 2017-06-26 02:27:20 -04:00
layout wibox.layout.flex: Do not leave empty space behind 2018-11-05 10:13:18 +01:00
widget Merge pull request #2249 from Aire-One/fix_widget_slider_doc 2018-04-26 20:46:54 -04:00
drawable.lua Add & use a dpi property on screen objects 2017-10-08 12:30:21 +02:00
hierarchy.lua wibox.hierarchy: Only count "really visible" widgets 2017-03-11 18:44:56 +01:00
init.lua doc: Mutualize the wibar and wibox constructor documentation. 2017-11-27 00:22:11 -05:00