Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calendar-widget: 'today' day is not set when opening the calendar #434

Open
Luka5W opened this issue Dec 14, 2023 · 0 comments
Open

calendar-widget: 'today' day is not set when opening the calendar #434

Luka5W opened this issue Dec 14, 2023 · 0 comments

Comments

@Luka5W
Copy link
Contributor

Luka5W commented Dec 14, 2023

When keeping the computer turned on over night, the current day/ today day is not updated. To update the day, the calendar popup has to be closed (which triggers the update, see calendar.lua#L229-L234) and opened again.

I've changed L228-235 in calendar.lua and test it a few weeks (because I'm too lazy to learn Lua or something). I'll create a PR if I know more.

-- OLD
       if popup.visible then
            -- to faster render the calendar refresh it and just hide
            cal:set_date(nil) -- the new date is not set without removing the old one
            cal:set_date(os.date('*t'))
            popup:set_widget(nil) -- just in case
            popup:set_widget(cal)
            popup.visible = not popup.visible
        else
-- NEW (not tested yet but should work (tm))
        if popup.visible then
            -- to faster render the calendar refresh it and just hide
            cal:set_date(nil) -- the new date is not set without removing the old one
            popup:set_widget(nil) -- just in case
            popup.visible = false
        else
            -- apply it when the calendar is opened! - probably slower but fixes the issue that the
            --  day is not updated when *opening* the popup (only when closing)
            cal:set_date(os.date('*t'))
            popup:set_widget(cal)
Luka5W added a commit to Luka5W/awesome-wm-widgets that referenced this issue Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant