Added calendar widget#721
Conversation
The widget is an embedded gtk4 calendar which can be styled as such. Written with the assistance of Qwen Code.
|
Closes #277 (see screenshot there) |
ErikReider
left a comment
There was a problem hiding this comment.
Just a few nits, looks good overall though :)
What's the use case for this? I don't think that the calendar widget integrates with the systems calendar to display events and such, so is it just for viewing the dates/week number?
Could you also provide a screenshot of how it looks with the day and date labels visible?
| container.set_margin_start (12); | ||
| container.set_margin_end (12); | ||
| container.set_margin_top (12); | ||
| container.set_margin_bottom (12); |
There was a problem hiding this comment.
We should set these through CSS so that it's user configurable
| container.set_margin_bottom (12); | ||
| container.set_hexpand (true); | ||
|
|
||
| day_label = new Gtk.Label (""); |
There was a problem hiding this comment.
Set the string argument to null instead of an empty string
| day_label.add_css_class ("day-label"); | ||
| day_label.set_halign (Gtk.Align.START); | ||
|
|
||
| date_label = new Gtk.Label (""); |
| @@ -0,0 +1,72 @@ | |||
| using GLib; | |||
| } | ||
|
|
||
| void update_labels () { | ||
| var now = new GLib.DateTime.now_local (); |
| margin-bottom: 8px; | ||
| } | ||
|
|
||
| calendar { |
There was a problem hiding this comment.
Might wanna use .calendar-widget instead
Thanks for reviewing!
As another user wrote on the issue, if you use waybar the calendar widget is pretty bad. This is just a replacement for that and for when you want to quickly look at a date or day.
I actually went back to a previous version cause I was experiencing a bug on the latest where floating notification backgrounds are randomly not rendering correctly. I will get a screenshot once I solve that and upgrade again to my fork. |
The widget is an embedded gtk4 calendar which can be styled as such.
Written with the assistance of Qwen Code.
This is good enough for me to use on my fork, but I don't have enough Vala or CSS knowledge to go any further.
Going to leave it here in case anyone wants to clean it up or offer some tips.
I think there is probably room for improvement with getting the GTK Calendar widget CSS to be accessible.