Skip to content

Added calendar widget#721

Draft
trevarj wants to merge 1 commit intoErikReider:mainfrom
trevarj:calendar-widget
Draft

Added calendar widget#721
trevarj wants to merge 1 commit intoErikReider:mainfrom
trevarj:calendar-widget

Conversation

@trevarj
Copy link
Copy Markdown

@trevarj trevarj commented Apr 1, 2026

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.

The widget is an embedded gtk4 calendar which can be styled as such.

Written with the assistance of Qwen Code.
@trevarj
Copy link
Copy Markdown
Author

trevarj commented Apr 1, 2026

Closes #277 (see screenshot there)

Copy link
Copy Markdown
Owner

@ErikReider ErikReider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +21 to +24
container.set_margin_start (12);
container.set_margin_end (12);
container.set_margin_top (12);
container.set_margin_bottom (12);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ("");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ("");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -0,0 +1,72 @@
using GLib;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

}

void update_labels () {
var now = new GLib.DateTime.now_local ();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GLib. prefix isn't needed

margin-bottom: 8px;
}

calendar {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might wanna use .calendar-widget instead

@trevarj
Copy link
Copy Markdown
Author

trevarj commented Apr 5, 2026

Just a few nits, looks good overall though :)

Thanks for reviewing!

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?

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.

Could you also provide a screenshot of how it looks with the day and date labels visible?

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.

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

Successfully merging this pull request may close these issues.

2 participants