At the moment `gcal_date_chooser_set_date()` is automatically setting
the day to 1, which is undesirable behavior for a method that is
designed to "just" set the date. By connecting to
`GcalMultiChoice::explicitly-changed`, we can simply have the day
set to 1 to accompanying callbacks.
Currently, `multi_choice_changed()` is invoked 50 times at startup.
By using `GcalMultiChoice::explicitly-changed`, `multi_choice_changed()`
is only invoked 10 times. This is still more than ideal, but it's
a significant drop.
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1639
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/837>
Change the 'get_first_weekday' function to number the weekdays
Monday(1)-Sunday(7) like ISO does. Change the function name to reflect
that. Add tests for different locales, although the tests depend on
system-installed locales.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
Start the enum from Monday-Sunday (1-7). Adapt code that references the
`is_workday()` utility method, which in turn uses the GcalWeekDay enum
to combine pairs of days by bitwise or-ing.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
When clicking the previous/next buttons, the view might not be aligned
to the start of the month, which can cause confusion.
Clamping the date to the first of the month removes this confusion by
being consistent. This also matches the behavior of the previous/next
buttons in the main toolbar.
Closes#1606
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/821>
The previous approach built tooltip strings by formatting a translated
category name (e.g. "Month") into a generic "Previous %1$s" template.
This is a classic gettext concatenation anti-pattern: languages with
grammatical gender (French, Spanish, German, …) need the adjective to
agree with the noun, and word order can differ from English, so
translators of the format string have no way to produce a correct
result.
Replace the format strings and their helper callbacks with two explicit
GObject properties on GcalMultiChoice: prev-button-tooltip-text and
next-button-tooltip-text. The buttons in the template now bind to
these properties directly. Each widget instance in gcal-date-chooser.blp
sets its own fully self-contained translatable string ("Previous month",
"Next month", "Previous year", "Next year"), giving translators all the
context they need to handle gender and word order correctly.
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1547
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/721>
While "7" may be obvious in the context of calendaring that
it represents the number of week days, it often gives me the
impression of it being a magic number when I'm hyperfocused on certain
parts of the codebase for several consecutive hours. Turning the
number into a macro helps me scan functions much more easily.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/674>
Since the calendar row widget is becoming an expandable widget,
several APIs were added to the widget:
- `gcal_calendar_row_get_calendar`
- `gcal_calendar_row_add_suffix`
- `gcal_calendar_row_get_first_suffix_child`
- `gcal_calendar_row_add_header_class`
- `gcal_calendar_row_remove_header_class`
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/362>
Currently, the quick add popover implements its own row
widget for each calendar, which duplicates tons of unnecessary
code. This commit streamlines the calendar-combo-row-item row
widget to make it reusable elsewhere.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/362>
The time direction property tells which orientation one
needs to scroll to change the time of the view. In these
directions (up/down v left/right) the new prev/next
buttons will be pointing.
The two buttons will be added in a subsequent commit,
and will gain view-dependent tooltips.
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>