feat: add auto hide functionality to calendar widget
This commit is contained in:
parent
effc902821
commit
2063b0e8e2
|
@ -203,6 +203,23 @@ local function worker(user_args)
|
|||
border_color = calendar_themes[theme].border,
|
||||
widget = cal
|
||||
}
|
||||
|
||||
local auto_hide_timer = gears.timer({
|
||||
timeout = user_args.timeout or 2,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
calendar_widget.toggle()
|
||||
end,
|
||||
})
|
||||
|
||||
popup:connect_signal("mouse::leave", function()
|
||||
if user_args.auto_hide then
|
||||
auto_hide_timer:again()
|
||||
end
|
||||
end)
|
||||
popup:connect_signal("mouse::enter", function()
|
||||
auto_hide_timer:stop()
|
||||
end)
|
||||
|
||||
popup:buttons(
|
||||
awful.util.table.join(
|
||||
|
@ -250,6 +267,10 @@ local function worker(user_args)
|
|||
end
|
||||
|
||||
popup.visible = true
|
||||
if user_args.auto_hide then
|
||||
auto_hide_timer:start()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue