From c0b9376da49d90a98d55b864b5bfec5d4aecbb34 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 19 Mar 2022 10:59:04 -0700 Subject: [PATCH] Improved language indicator --- desktop/popups/language.lua | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/desktop/popups/language.lua b/desktop/popups/language.lua index d4bd3d0..9a9f7be 100644 --- a/desktop/popups/language.lua +++ b/desktop/popups/language.lua @@ -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 = "" .. l["title"] .. "", + align = "left", + valign = "center", + font = "Comfortaa 16", + widget = wibox.widget.textbox + }, + layout = wibox.container.background, + } - language.widget:add_widget_at(wibox.widget { - markup = "" .. l["title"] .. "", - 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,