This changes the align layout fit function so that align:fit will not return
more space than is actually needed by its sub-widgets. Changes to align:draw
were also required so that any widget assigned to the middle slot will expand
to fill the remaining space.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a :set_color() method so that the margin layout can color the margins,
drawing a bordered widget.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The last widget always took up the remaining
space even though fill_space(false)
had been called on the layout.
This got broken in commit 9d333113dd.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit adds and uses wibox.layout.base.fit_widget(). This function is a
wrapper for widget:fit() that caches the result and thus speeds things up.
This is necessary because some layouts call :fit() from their :fit() and :draw()
functions. Nesting such layouts means that at the widget at the tail of the
stack gets its :fit() function called quite often. If this function is not
blazingly fast, this results in noticeable slowness.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The flex:fit() function was calling the fit() function of the widgets it
contained with too large values, trying to hand out more space than it had
available. This resulted in more space being requested than was available and
some weird layout issues resulted.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes mixed up min/max strategies and other bugs in min and max. Also
removes enforcing the size in draw, adhering more to awesome's layout
concept.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The function can be used to set the maximum size the widget in the
flex layout should take.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
I amended some change to commit 8560de597c which made the align layout's
middle widget really centered instead of being way too wide. However, this also
shrunk the widget on the "other" axis, too. This commit fixes that up.
A big "sorry" to Lukáš for breaking his patch.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This layout can be used to constraint the size of the widget it holds.
Depending on the strategy passed to it, the widget will have a minimum,
maximum or exact size that was set through this layout.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Centers the middle widget in the align layout in the remaining space
left by the widgets on the sides.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds a fit function to the align layout that makes sure that
the layout will not take up all the available space in the other
axis than it's direction. Eg. for horizontal align layout, it will
only take up the maximum of its widgets' heights in the vertical axis.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The fit function of the flex layout is different from the fixed.fit one.
Signed-off-by: Lukáš Hrázký <lukkash@email.cz>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This replaces lots of function foo.bar(this, ...) with function foo:bar(...).
There should be no other changes in this commit.
The point is to make it easier for api documentation tools to figure out that
these are methods on objects.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Without this, input handling is broken (draw_widget() registers each widget with
its position for input handling).
This also removes some unnecessary save()/restore() calls. Our caller (again
draw_widget()) already does that for us.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:
#!/bin/ksh
git ls-tree -r HEAD | cut -f2 | while read f; do
egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
mv /tmp/foo $f
done
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
If a widget has a width/height of 0, we can safely draw it without running out
of the available space. This code checks if we got enough space after we now how
much space the next widget wants.
This fixes the systray. It has to be drawn at least once so that the C core can
set up stuff correctly. However, thanks to the systray having a width of 0, it
wasn't drawn by the layout.
Signed-off-by: Uli Schlachter <psychon@znc.in>