From f46afcf1ce506a4e6b390e7dd13a0f4ca853e5e2 Mon Sep 17 00:00:00 2001
From: streetturtle <streetturtle@gmail.com>
Date: Fri, 5 Mar 2021 20:47:00 -0500
Subject: [github-activity] highlight icon when opened

---
 github-activity-widget/github-activity-widget.lua |  29 +++++++++++-----------
 github-activity-widget/screenshot.png             | Bin 43288 -> 93186 bytes
 2 files changed, 15 insertions(+), 14 deletions(-)

(limited to 'github-activity-widget')

diff --git a/github-activity-widget/github-activity-widget.lua b/github-activity-widget/github-activity-widget.lua
index b4a313a..af29b35 100644
--- a/github-activity-widget/github-activity-widget.lua
+++ b/github-activity-widget/github-activity-widget.lua
@@ -111,23 +111,22 @@ end
 local github_widget = wibox.widget {
     {
         {
-            id = 'icon',
-            widget = wibox.widget.imagebox
+            {
+                id = 'icon',
+                widget = wibox.widget.imagebox
+            },
+            id = "m",
+            margins = 4,
+            layout = wibox.container.margin
         },
-        id = "m",
-        margins = 4,
-        layout = wibox.container.margin
-    },
-    {
-        id = "txt",
-        widget = wibox.widget.textbox
+        layout = wibox.layout.fixed.horizontal,
     },
-    layout = wibox.layout.fixed.horizontal,
-    set_icon = function(self, new_icon)
-        self.m.icon.image = new_icon
+    shape = function(cr, width, height)
+        gears.shape.rounded_rect(cr, width, height, 4)
     end,
-    set_text = function(self, new_value)
-        self.txt.text = new_value
+    widget = wibox.container.background,
+    set_icon = function(self, new_icon)
+        self:get_children_by_id("icon")[1].image = new_icon
     end
 }
 
@@ -264,7 +263,9 @@ local function worker(user_args)
                     awful.button({}, 1, function()
                         if popup.visible then
                             popup.visible = not popup.visible
+                            github_widget:set_bg('#00000000')
                         else
+                            github_widget:set_bg(beautiful.bg_focus)
                             spawn.easy_async(string.format(GET_EVENTS_CMD, CACHE_DIR, number_of_events),
                                 function (stdout, stderr)
                                     rebuild_widget(stdout, stderr)
diff --git a/github-activity-widget/screenshot.png b/github-activity-widget/screenshot.png
index 175a755..f066cbc 100644
Binary files a/github-activity-widget/screenshot.png and b/github-activity-widget/screenshot.png differ
-- 
cgit v1.2.3