mirror of
https://github.com/streetturtle/awesome-wm-widgets.git
synced 2024-11-17 07:49:09 +01:00
[weather] highlight widget when the popup is shown
This commit is contained in:
parent
f46afcf1ce
commit
0054af2de3
1 changed files with 22 additions and 10 deletions
|
@ -149,18 +149,28 @@ local function worker(user_args)
|
|||
weather_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
id = 'icon',
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
{
|
||||
{
|
||||
id = 'icon',
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
valign = 'center',
|
||||
widget = wibox.container.place,
|
||||
},
|
||||
{
|
||||
id = 'txt',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
valign = 'center',
|
||||
widget = wibox.container.place,
|
||||
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_image = function(self, path)
|
||||
self:get_children_by_id('icon')[1].image = path
|
||||
end,
|
||||
|
@ -530,8 +540,10 @@ local function worker(user_args)
|
|||
|
||||
weather_widget:buttons(awful.util.table.join(awful.button({}, 1, function()
|
||||
if weather_popup.visible then
|
||||
weather_widget:set_bg('#00000000')
|
||||
weather_popup.visible = not weather_popup.visible
|
||||
else
|
||||
weather_widget:set_bg(beautiful.bg_focus)
|
||||
weather_popup:move_next_to(mouse.current_widget_geometry)
|
||||
end
|
||||
end)))
|
||||
|
|
Loading…
Reference in a new issue