mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 09:15:22 +01:00
[GH-ISSUE #931] Calendar date not being updated #4499
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#4499
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @postsolar on GitHub (Apr 8, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/931
Describe the bug
Calendar popup reported April 6th today (on April 8th). Fixed with
systemctl --user restart ironbar.serviceTo Reproduce
Looking for a way to reproduce. Would changing system time be appropriate?
Expected behavior
System information:
Configuration
Config
Styles
Additional context
Config is applied via IRONBAR_CONFIG in a systemd unit
Screenshots
@postsolar commented on GitHub (Apr 9, 2025):
Ok I can reproduce this as in the date keeps not getting updated at midnight, so not a one-off occurence.
@postsolar commented on GitHub (May 19, 2025):
From what I understand gtk3-rs just doesn't expose anything here to have it nicely?
@JakeStanger commented on GitHub (May 19, 2025):
I think GTK4's calendar widget does offer a lot more functionality, but there are methods in GTK3 that looks like they do the right thing.
https://gtk-rs.org/gtk3-rs/git/docs/gtk/prelude/trait.CalendarExt.html#tymethod.mark_day
https://gtk-rs.org/gtk3-rs/git/docs/gtk/prelude/trait.CalendarExt.html#tymethod.select_day
I've never played with any of them though.
@postsolar commented on GitHub (May 19, 2025):
I think I now understand the issue to be more broad:
Whether it's sensible to have this tradeoff, I don't know. I personally don't use date selection and would be fine with it resetting to current date across popup open/close cycles.
@JakeStanger commented on GitHub (May 19, 2025):
Date selection doesn't do anything so I think it's fine to reset that whenever the popup opens, or on a timer at midnight.
The alternative is to 'mark' and/or show details for the day and then show markings so that it's independent of the selection (assuming the markings system works as one would expect).
@JakeStanger commented on GitHub (May 20, 2025):
Related: #244
@postsolar commented on GitHub (May 20, 2025):
Markings are just bold text apparently, less noticeable than selections. So if someone launched Ironbar on 19.05, then on 20.05 they decided to open the calendar, there would be very visible "selected" 19.05 day and hardly noticeable marked 20.05 current day. I think using selections would result in more intuitive UI. Though if there's a way to have markings be more (or as) visible than selections then it might work.
In case we're using selections, I'm not sure if updating the date just at midnight is enough. Say, it's 20.05 01:00, I click some buttons in the calendar thus selecting another day, then go to sleep. Next day (but same date) I wake up and the calendar shows me the wrong date. So I'm more in favor of resetting it on popup opens.
Speaking of which, what is the right way to hook into popup opens?
I tried a simple
but it has no effect at all.
@JakeStanger commented on GitHub (May 20, 2025):
So there's this mysterious details feature (I think you need to also
set_show_details(true)) that might work nicely in addition, but I haven't been able to find out what it does from Googling at least.https://gtk-rs.org/gtk3-rs/git/docs/gtk/prelude/trait.CalendarExt.html#tymethod.set_detail_func
I'm thinking there surely has to be a way to target the calendar internals with CSS too. Would have to pull apart a GTK theme to find out though.
The container parent should be the actual popup window (changing to a native popup element with GTK4). That is what gets shown/hidden so you should be able to listen to that.
I think you can get the popup window through either
context.popup.windoworcontainer.parent.