Improved language indicator

master
Mark 2022-03-19 10:59:04 -07:00
parent 4f9922cd3a
commit c0b9376da4
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 22 additions and 10 deletions

View File

@ -31,15 +31,22 @@ for k, l in pairs(language.language_list) do
shape = gears.shape.circle,
}
language.widget:add_widget_at(l["widget_checkbox"], k, 1, 1, 1)
l["widget_text"] = wibox.widget {
{
markup = "<b>" .. l["title"] .. "</b>",
align = "left",
valign = "center",
font = "Comfortaa 16",
widget = wibox.widget.textbox
},
layout = wibox.container.background,
}
language.widget:add_widget_at(wibox.widget {
markup = "<b>" .. l["title"] .. "</b>",
align = "left",
valign = "center",
font = "Comfortaa 23",
widget = wibox.widget.textbox
}, k, 2, 0, 1)
l["widget_text"].bg = "#00000000"
language.widget:add_widget_at(l["widget_text"], k, 1, 1, 1)
--language.widget:add_widget_at(l["widget_checkbox"], k, 1, 1, 1)
--language.widget:add_widget_at(l["widget_text"], k, 2, 0, 1)
end
language.next = function()
@ -63,6 +70,11 @@ end
language.update_checks = function()
for _, l in pairs(language.language_list) do
if (wrapper.ibus.current_engine == l["ibus_engine"]) then
l["widget_text"].bg = "#FF0000"
else
l["widget_text"].bg = "#00000000"
end
l["widget_checkbox"].checked = (wrapper.ibus.current_engine == l["ibus_engine"])
end
end
@ -94,9 +106,9 @@ language.popup = awful.popup {
visible = false,
hide_on_right_click = true,
shape = gears.shape.rounded_rect,
shape = gears.shape.rectangle,
placement = function(d)
return awful.placement.centered(d, {
return awful.placement.bottom_right(d, {
honor_workarea = true
})
end,