diff options
author | streetturtle <streetturtle@gmail.com> | 2020-09-03 21:28:01 -0400 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2020-09-03 21:28:01 -0400 |
commit | cbe255727385b4b86a3d328c8c7479a8cacbf305 (patch) | |
tree | 9a7ffec3f2530a7f09595bb4f5b73a21b51b247b /jira-widget | |
parent | 23d1090d027e2339322db3a61e0b7db7cdef539d (diff) |
[jira] refactoring
Diffstat (limited to 'jira-widget')
-rw-r--r-- | jira-widget/jira.lua | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/jira-widget/jira.lua b/jira-widget/jira.lua index 15bce19..af85cf2 100644 --- a/jira-widget/jira.lua +++ b/jira-widget/jira.lua @@ -65,18 +65,18 @@ local jira_widget = wibox.widget { self.txt.text = new_value end, set_icon = function(self, path) - self.a.b.c.image = path + self:get_children_by_id('c')[1]:set_image(path) end, is_everything_ok = function(self, is_ok) if is_ok then - self.a.b.d:set_visible(false) - self.a.b.c:set_opacity(1) - self.a.b.c:emit_signal('widget:redraw_needed') + self:get_children_by_id('d')[1]:set_visible(false) + self:get_children_by_id('c')[1]:set_opacity(1) + self:get_children_by_id('c')[1]:emit_signal('widget:redraw_needed') else self.txt:set_text('') - self.a.b.d:set_visible(true) - self.a.b.c:set_opacity(0.2) - self.a.b.c:emit_signal('widget:redraw_needed') + self:get_children_by_id('d')[1]:set_visible(true) + self:get_children_by_id('c')[1]:set_opacity(0.2) + self:get_children_by_id('c')[1]:emit_signal('widget:redraw_needed') end end } @@ -92,7 +92,6 @@ local popup = awful.popup{ widget = {} } - local number_of_issues local warning_shown = false @@ -117,7 +116,7 @@ local function worker(args) show_warning(stderr) warning_shown = true widget:is_everything_ok(false) - tooltip:add_to_object(jira_widget) + tooltip:add_to_object(widget) widget:connect_signal('mouse::enter', function() tooltip.text = stderr @@ -127,7 +126,7 @@ local function worker(args) end warning_shown = false - tooltip:remove_from_object(jira_widget) + tooltip:remove_from_object(widget) widget:is_everything_ok(true) local result = json.decode(stdout) |