Skip to content

Commit 8725950

Browse files
committed
feat: add preview on hover
This was a nice contribution! Co-authored-by: trap000d Signed-off-by: André Jaenisch <[email protected]>
1 parent f5e81de commit 8725950

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

weather-api-widget/weather.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,18 @@ local function worker(user_args)
619619
end
620620
end)))
621621

622+
weather_widget:connect_signal("mouse::enter", function()
623+
weather_widget:set_bg(beautiful.bg_focus)
624+
weather_popup:move_next_to(mouse.current_widget_geometry)
625+
end)
626+
627+
weather_widget:connect_signal("mouse::leave", function()
628+
if weather_popup.visible then
629+
weather_widget:set_bg('#00000000')
630+
weather_popup.visible = not weather_popup.visible
631+
end
632+
end)
633+
622634
watch(
623635
string.format(GET_FORECAST_CMD, weather_api),
624636
timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good

0 commit comments

Comments
 (0)