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