mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
wibox.widget.textbox: return 0, 0 from fit() if either w or h is 0
A hack around abusing the fact that width of a textbox is 0 when its empty, while it's height is still set according to the font. Signed-off-by: Lukáš Hrázký <lukkash@email.cz> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
1881ceb9d3
commit
470142acc3
1 changed files with 5 additions and 0 deletions
|
@ -45,6 +45,11 @@ end
|
|||
function textbox:fit(width, height)
|
||||
setup_layout(self, width, height)
|
||||
local ink, logical = self._layout:get_pixel_extents()
|
||||
|
||||
if logical.width == 0 or logical.height == 0 then
|
||||
return 0, 0
|
||||
end
|
||||
|
||||
return logical.width, logical.height
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue