Commit Graph
37 Commits
Author SHA1 Message Date
Zelda Ahmed e16e33783e common/calendar-row: Cast the returned value of g_object_get_data
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/849>
2026-10-02 21:39:10 +00:00
6bba8e2cc8 common/date-chooser: Increment or decrement year when GcalMultiChoice wraps
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/97
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1484

Co-authored-by: mindonwarp <mind.on.warp@gmail.com>
Co-authored-by: Koc13 <ilija.kocinac@proton.me>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/853>
2026-10-02 13:32:27 +00:00
Hari Rana 5aec783a85 common/date-chooser: Use GcalMultiChoice::user-changed
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>
2026-09-30 14:57:26 -04:00
Hari Rana 6fd70d4f65 common/multi-choice: Use gcal_multi_choice_get_max_value()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00:00
Hari Rana 169902ecba event-editor/multi-choice: Use GcalStackLabel
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00:00
Hari Rana 1a3ba22430 common/stack-label: Introduce GcalStackLabel
This is meant to be used for widgets which desire to have an equal
amount of width allocated onto every label.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00:00
mindonwarp a6a977e5ca views: Redraw the date chooser (mini-calendar) after changing week-start-day
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:22:00 +00:00
mindonwarp 107d4a067e gui: Use the new GcalContext API to get week start day once
This gets the globally set start-of-week setting on application startup.
Making the views redraw themselves on setting change while running will
be a later step.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:22:00 +00:00
mindonwarp acd8fbaf69 utils: Use ISO weekday numbering for 'get_first_weekday' function
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>
2026-09-26 17:22:00 +00:00
mindonwarp c0a74ed76f utils: Align GcalWeekDay enum with ISO 8601
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>
2026-09-26 17:21:57 +00:00
Hari Rana f91e21aaa9 common/date-chooser: Add row and column spacing
This adds back the spacing lost by the removal of margins
in the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana 65896c6ece utils: Prefix macros with GCAL_
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:24 +00:00
Hari Rana 117c032d95 utils: Prefix every function with gcal_util_
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:24 +00:00
Hari Rana d1e9443b62 common/date-chooser: Remove animate property
We no longer use this property per the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana 681e24a772 common/date-chooser: Remove wrap property
This no longer exists per the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana dfb9ea645c common/date-chooser: Use GcalGizmo
GcalGizmo allows us to handle focus within child widgets
much more cleanly, as it no longer requires us to override the
ancestor and re-iterating through children.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/760>
2026-09-16 12:22:36 +00:00
ARAKHNID 2c4faa8f3a date-chooser: Clamp to first day of month when clicking previous/next buttons
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>
2026-09-16 12:00:33 +00:00
Georges Basile Stavracas Neto cd82c2c52c gui/date-chooser: Properly remove idle source
When disposing of the widget, also remove the associated idle source
that might exist. This prevents a crash.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto afd9f9b954 core/timeline: Remove message queueing and listeners
"Let go and move on." - The Fool?

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto 136fd16a0a gui/date-chooser: Port to GListModel
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Hari Rana ccd3e5cae3 common/date-chooser: Replace "context" method with context getter method
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/702>
2026-03-23 19:30:00 +00:00
Guillaume Bernard 5a663ee671 multi-choice: Fix i18n of navigation button tooltips
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>
2026-03-10 20:43:02 -03:00
Hari Rana 50e048c7e0 utils: Turn number of weekdays into a macro
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>
2026-03-08 21:53:40 -04:00
Fabian Hügel 66a8c6b7ab common/date-chooser: Jump to first day of month on button press
Encode the day in the combined choice value and use the callbacks
introduced in the previous commit to always jump to the first day
of the month when the next/previous month buttons are clicked.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1103
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/369>
2026-02-21 20:22:34 -05:00
Zoey Ahmed 272f7fd34f multi-choice: Bind category to tooltip + a11y label
This adds a tooltip to the multi choice buttons, with the text
"Previous/Next (category)". This fixes the warnings in the date
chooser popover.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/681>
2026-01-29 02:21:43 +00:00
Zoey Ahmed f32eae827e calendar-row: Add presentation role to color dot img
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/681>
2026-01-29 02:21:42 +00:00
Hari Rana 7e63f5f7e2 calendar-row: Add APIs
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>
2025-11-18 11:37:18 -03:00
Hari Rana f8c5751174 calendar-row: Rename calendar-combo-row-item to calendar-row
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>
2025-11-18 11:37:07 -03:00
Hari Rana ba716102b9 common/date-chooser: Make arrow left/right move focus across grid
This also notifies the user when out of bound with arrow buttons.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1036
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/608>
2025-07-05 21:07:50 +00:00
Hari Rana 032a71dde6 common/date-chooser: Skip calendar grid with tab
Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1036
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/608>
2025-07-05 21:07:50 +00:00
Hari Rana d809192dd5 common/date-chooser: Wrap months
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/603>
2025-06-29 08:51:46 -04:00
Hari Rana 7a40a3be6a common/date-chooser: Add accessible labels to GcalMultiChoice widgets
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/603>
2025-06-29 08:51:27 -04:00
Jamie Gravendeel a509de8b1e gui: Port to Blueprint
This was mostly done with `blueprint-compiler port`.

Since Blueprint doesn't know about custom templates, I had to manually change some values from strings to literals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/567>
2025-06-08 14:31:01 +02:00
Markus Göllnitz 4a4dce8ee3 views: add time direction property
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>
2025-06-08 09:59:00 +00:00
Titouan Real 931254c2a4 common/date-chooser: Housekeeping
Add some assertions and comments
2025-04-09 15:35:20 +00:00
Titouan Real 303cba1622 gui: Move DateChooser to common
DateChooser is used both by the event editor and the main window.
Moving it to common for a better file organization.
2025-04-09 15:35:20 +00:00
Titouan Real 0aa0619e99 gui: Move CalendarComboRow to common
CalendarComboRow is used both by the event editor and the importer.
Moving it to common for a better file organization.
2025-04-09 15:35:20 +00:00