Built-in Calendar Gramplet

Can our Calendar Gramplet have Day of the Week column headers without sacrificing the selector controls?

The Calendar Gramplet is missing day of the week labels. But if the display option for SHOW_HEADING

        self.gui.calendar.set_display_options(
			Gtk.CalendarDisplayOptions.SHOW_HEADING)

image

Is changed to:

        self.gui.calendar.set_display_options(
			Gtk.CalendarDisplayOptions.SHOW_DAY_NAMES)

image

Then you lose the Month & Year controls. It doesn’t seem to like the options combined with commas or applied sequentially in separate statements.

Combine options with bar delimiter:
    self.gui.calendar.set_display_options(
        Gtk.CalendarDisplayOptions.SHOW_DAY_NAMES |
        Gtk.CalendarDisplayOptions.SHOW_WEEK_NUMBERS |
        Gtk.CalendarDisplayOptions.SHOW_HEADING)

It also seems strange that the GTK widget library doesn’t seem to have a European calendar – where the weeks start on Mondays. [Automatically adjusts to the locality]

I was initially looking at this Gramplet hoping to add « (U+00AB) and » (U+00BB) to move by decades instead of years. But that appears to not be an option either.

Based on other applications (that don’t support spans, ranges or date quality), I had anticipated a simple calendar selector when clicking the “Daily Calendar” gadget beside the Date field. Instead, the more complex “Date Selection” dialog appears.

image

You can do that with:

    self.gui.calendar.set_display_options(
        Gtk.CalendarDisplayOptions.SHOW_DAY_NAMES |
        Gtk.CalendarDisplayOptions.SHOW_HEADING)
1 Like

The calendar gramplet is based on Gtk.Calendar widget.
You can’t add methods, preferences, …

1 Like

Thanks! (Filed feature request 12515/Pull 1319)

That’s unfortunate.

Perhaps it might be possible to have date field in the Gramplet that is synched to the widget? So that you could jump the calendar directly to a date years in the past?

This would be a useful reference for when hand parsing source record (such as an obit) that refers to day of the week in relative terms to its current date. As in “died Tuesday” in an obituary dated 7 Aug 2021.

I noted that the tooltip on line 48 is inaccurate too. [Filed bug report 12514]

 ​        ​self​.​set_tooltip​(​_​(​"Double-click a day for details"​))

Double-click actually opens the “On This Day” Quick View. Although the more important tip might be that the day is draggable.