feat(awful: hotkeys_poup): better visually split multiple keys

This commit is contained in:
actionless 2020-09-26 04:43:12 +02:00
parent 20a79ed448
commit a2674c2d14
1 changed files with 12 additions and 1 deletions

View File

@ -492,8 +492,19 @@ function widget.new(args)
else else
modifiers = markup.fg(self.modifiers_fg, modifiers.."+") modifiers = markup.fg(self.modifiers_fg, modifiers.."+")
end end
local key_label = ""
if key.keylist and #key.keylist > 1 then
for each_key_idx, each_key in ipairs(key.keylist) do
key_label = key_label .. each_key
if each_key_idx ~= #key.keylist then
key_label = key_label .. markup.fg(self.modifiers_fg, '/')
end
end
elseif key.key then
key_label = key.key
end
local rendered_hotkey = markup.font(self.font, local rendered_hotkey = markup.font(self.font,
modifiers .. (key.key or "") .. " " modifiers .. key_label .. " "
) .. markup.font(self.description_font, ) .. markup.font(self.description_font,
key.description or "" key.description or ""
) )