summaryrefslogtreecommitdiff
path: root/todo-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2021-03-06 13:31:22 -0500
committerstreetturtle <streetturtle@gmail.com>2021-03-06 13:31:22 -0500
commit223fe7226a6d8d0a48bb321ae1b307f635e9e65b (patch)
tree34926e6aac8ecef2b37c461f05a89f561f4e1dd0 /todo-widget
parent36ff9d53b78271491178f016654b95f6bd6bfaf5 (diff)
[todo] highlight widget when the popup is shown
Diffstat (limited to 'todo-widget')
-rw-r--r--todo-widget/todo.lua36
1 files changed, 25 insertions, 11 deletions
diff --git a/todo-widget/todo.lua b/todo-widget/todo.lua
index b8ce3cf..78ca262 100644
--- a/todo-widget/todo.lua
+++ b/todo-widget/todo.lua
@@ -27,23 +27,35 @@ local update_widget
todo_widget.widget = wibox.widget {
{
{
- id = "icon",
- widget = wibox.widget.imagebox
+ {
+ {
+ id = "icon",
+ forced_height = 16,
+ forced_width = 16,
+ widget = wibox.widget.imagebox
+ },
+ valign = 'center',
+ layout = wibox.container.place
+ },
+ {
+ id = "txt",
+ widget = wibox.widget.textbox
+ },
+ spacing = 4,
+ layout = wibox.layout.fixed.horizontal,
},
- id = "margin",
margins = 4,
layout = wibox.container.margin
},
- {
- id = "txt",
- widget = wibox.widget.textbox
- },
- layout = wibox.layout.fixed.horizontal,
+ shape = function(cr, width, height)
+ gears.shape.rounded_rect(cr, width, height, 4)
+ end,
+ widget = wibox.container.background,
set_text = function(self, new_value)
- self.txt.text = new_value
+ self:get_children_by_id("txt")[1].text = new_value
end,
set_icon = function(self, new_value)
- self.margin.icon.image = new_value
+ self:get_children_by_id("icon")[1].image = new_value
end
}
@@ -302,11 +314,13 @@ local function worker(user_args)
end
todo_widget.widget:buttons(
- awful.util.table.join(
+ gears.table.join(
awful.button({}, 1, function()
if popup.visible then
+ todo_widget.widget:set_bg('#00000000')
popup.visible = not popup.visible
else
+ todo_widget.widget:set_bg(beautiful.bg_focus)
popup:move_next_to(mouse.current_widget_geometry)
end
end)