fix(awful: hotkeys): compute length of the line correctly
This commit is contained in:
parent
64bd09d38d
commit
3a9f7a1cee
|
@ -257,14 +257,15 @@ local function create_wibox(s, available_groups)
|
||||||
local max_label_content = ""
|
local max_label_content = ""
|
||||||
local joined_labels = ""
|
local joined_labels = ""
|
||||||
for i, key in ipairs(_keys) do
|
for i, key in ipairs(_keys) do
|
||||||
|
local length = string.len(key.key or '') + string.len(key.description or '')
|
||||||
local modifiers = key.mod
|
local modifiers = key.mod
|
||||||
if not modifiers or modifiers == "none" then
|
if not modifiers or modifiers == "none" then
|
||||||
modifiers = ""
|
modifiers = ""
|
||||||
else
|
else
|
||||||
|
length = length + string.len(modifiers) + 1 -- +1 for "+" character
|
||||||
modifiers = markup.fg(widget.modifiers_color, modifiers.."+")
|
modifiers = markup.fg(widget.modifiers_color, modifiers.."+")
|
||||||
end
|
end
|
||||||
local hotkey = modifiers .. (key.key or '')
|
local hotkey = modifiers .. (key.key or '')
|
||||||
local length = string.len(hotkey) + string.len(key.description)
|
|
||||||
local rendered_hotkey = markup.font(widget.title_font, hotkey.." ") ..
|
local rendered_hotkey = markup.font(widget.title_font, hotkey.." ") ..
|
||||||
(markup.font(widget.description_font, key.description) or "")
|
(markup.font(widget.description_font, key.description) or "")
|
||||||
if length > max_label_width then
|
if length > max_label_width then
|
||||||
|
|
Loading…
Reference in New Issue