feat: add preview on hover
This was a nice contribution! Co-authored-by: trap000d Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
parent
f5e81dea79
commit
87259502cf
|
@ -619,6 +619,18 @@ local function worker(user_args)
|
||||||
end
|
end
|
||||||
end)))
|
end)))
|
||||||
|
|
||||||
|
weather_widget:connect_signal("mouse::enter", function()
|
||||||
|
weather_widget:set_bg(beautiful.bg_focus)
|
||||||
|
weather_popup:move_next_to(mouse.current_widget_geometry)
|
||||||
|
end)
|
||||||
|
|
||||||
|
weather_widget:connect_signal("mouse::leave", function()
|
||||||
|
if weather_popup.visible then
|
||||||
|
weather_widget:set_bg('#00000000')
|
||||||
|
weather_popup.visible = not weather_popup.visible
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
string.format(GET_FORECAST_CMD, weather_api),
|
string.format(GET_FORECAST_CMD, weather_api),
|
||||||
timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good
|
timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good
|
||||||
|
|
Loading…
Reference in New Issue