Commit Graph
3553 Commits
Author SHA1 Message Date
Zelda Ahmed 65ae1c5ef2 views/agenda: Remove unsued ChildData structure
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/866>
2026-10-04 16:29:22 +01:00
Zelda Ahmed 5996b00108 views/agenda: Remove unused items in structure
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/866>
2026-10-04 16:29:22 +01:00
Hari Rana e27e477e69 gui/calendar-navigation-button: Fix memory leak
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/865>
2026-10-04 14:06:44 +00:00
mindonwarp 6f511b600a appdata: Add release info tag for 52~alpha
Since we now have fatal criticals enabled, we are prone to crashes
caused by our external dependencies emitting criticals. The newest case
is the Adwaita About dialog. The critical happened because `ministream`
couldn't find a release tag for 52.0

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/864>
2026-10-04 12:35:19 +02:00
Hari Rana b1f6e609c6 views/week-grid: Only set parent when child_data->widget has been created
`add_event_to_block()` assumes that the child widget has never been
parented, so it will always set the parent widget when the widget
is already parented, which triggers a critical error in GTK.

This patch addresses this situation by only parenting when the
widget has just been created. Additionally, it asserts that the
parent widget is `self` in the end, so that it crashes if this
is incorrect.

Fixes: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1643>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/863>
2026-10-03 19:24:19 -04:00
mindonwarp 81fa0f29c4 core: Catch errors when trying to read from settings portal
`g_dbus_proxy_call_sync` will return NULL and set the recoverable
`error` in case of failure.

We didn't catch this previously so reading the variant from the return
value caused a CRITICAL because a user didn't have the `week-start-day`
setting (introduced in 50.alpha) and the returned `GVariant` was NULL.

Now, we check whether en error is set after calling
`g_dbus_proxy_call_sync` and propagate it to the calling method so it
can gracefully handle it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/862>
2026-10-03 13:26:49 +02:00
mindonwarp 0a72c05311 views/agenda: Fix critical in first weekday changed
The `gcal_agenda_view_first_weekday_changed` uses the same
`gtk_list_view_scroll_to` method that expects the scroll position to be
smaller than the number of items in the list model.

When the list model contains no items, the method reports a critical
which crashes the Calendar whith `fatal-criticals` enabled.

This is the same fix that Georges made in the
`gcal_agenda_view_set_date` method. We now check the number of items
before trying to scroll the list view to position zero.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/861>
2026-10-03 12:58:02 +02:00
Zelda Ahmed d163d1bf82 gui/window: 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
Zelda Ahmed 7b9072fdac gui/calendar-list: 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
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
Zelda Ahmed 43fdb229c5 calendar-management/page: 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
ARAKHNID a635ca51ed gui/views/week-view: Add shortcuts for zooming in/out
It's possible to change the density of the week view, but only through
pinch-zooming or Ctrl+scroll wheel. This means it can't be done with
only the keyboard, and since neither of these methods are documented,
it's not discoverable either.

This adds shortcuts for zooming the view in and out, and documents them
in the shortcuts dialog to make them discoverable.

Helps #1556

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/859>
2026-10-02 21:33:57 +00:00
Georges Basile Stavracas Neto a1c3439535 views/agenda: Only scroll when there are items
`gtk_list_view_scroll_to()` is documented to require that `pos` is
smaller than the number of items in the model. We were not checking
if the model was empty before calling this function, which could
lead to criticals.

Check if the listview model has any items before scrolling it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/860>
2026-10-02 18:19:13 -03:00
Georges Basile Stavracas Neto 6c2bc5be46 core/log: Improve logging
- Stop using GDateTime formatting as that's super slow!
- Log the thread id as wel

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:05 +00:00
Georges Basile Stavracas Neto 509165286e gui/application: Change --debug to --verbose
And support multiple calls to it. Each call increase the verbose
level, up to level 4. Level 4 increases all tracing.

You can run Calendar as:

$ gnome-calendar -vvvv

now and that'll enable tracing.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1234
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:05 +00:00
Georges Basile Stavracas Neto a3598c0c11 main: Always initialize logging
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:05 +00:00
Georges Basile Stavracas Neto c4c5c81cdf core/log: Enable tracing with G_MESSAGES_DEBUG=all
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:04 +00:00
Georges Basile Stavracas Neto b82f6bbcb8 core/log: Support verbosity levels
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:04 +00:00
Georges Basile Stavracas Neto d0e8fa85b3 gui/application: Change --version shortname to uppercase V
This will free -v for --verbose

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/858>
2026-10-02 13:58:03 +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 1c5b826af0 gui/window: Only enable "win.today" action on the current day
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1021
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1066
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/839>
2026-10-01 13:34:54 -04:00
Hari Rana b2838e034f views/month-view: Follow day of week when scrolling
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/839>
2026-10-01 13:33:04 -04:00
Hari Rana 11294bd1ac utils: Add macro for computing days after first weekday
Currently, `gcal_date_time_get_start_of_week()` seems to be
the only user of this macro function. In the next commit, the
month view will use it to traverse weeks while maintaining
the weekday.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/839>
2026-10-01 13:31:55 -04: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 be244e13c8 event-editor/multi-choice: Add signal for emitting explicit changes
We currently rely on connecting the `notify::value` signal,
which is emitted every time the value is changed explicitly or
implicitly. This can be problematic when, for example, the user
scrolls in the month view, which changes the value of each
GcalDateChooser widget, and each minor difference will re-emit
the signal until it's over. The `GcalMultiChoice::user-changed`
signal will only emit when the user presses the
previous/next buttons.

The next commit will port GcalDateChooser
to `GcalMultiChoice::user-changed`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/837>
2026-09-30 14:57:26 -04:00
Hari Rana 68ac34e8d8 event-editor/multi-choice: Document and rearrange properties and signals
This rearranges and documents the rest of the properties, as well
as providing getter and setter methods for properties that don't
have any.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00: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 096139721d gui/multi-choice: Rework value properties
This changes the way the current value is being set, as well as
proper getter and setter methods for respective min and max values.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00:00
Hari Rana 12c30b818e event-editor/multi-choice: Add "numeric" style class
See: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html#numeric
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
Hari Rana c9f273a47a event-editor/multi-choice: Consolidate action activation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:37 +00:00
Hari Rana cc655b6459 event-editor/multi-choice: Wrap values mathematically
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/754>
2026-09-30 18:34:36 +00:00
mindonwarp 93c7bdcb6a views: Redraw the agenda view when week-start-day changes
Updates the visible rows after the selected date shifts within the week.
The agenda view displays all events starting from the selected day and
up until the last day of the same week.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 20:03:20 +02: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 be55238eaa views: Redraw month view rows 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 1fd99f71b2 views: Redraw week view 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 fc5cf5229c gui: Extend the GcalView interface with a method to redraw the weekday layout
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 a0a6ae2a2c core/utils: Find the actual 'default' locale start of week day
Use the gcal-utils to find the actual day in case the desktop setting
for start of week is set to 'default'. After this commit, all usages of
that function have to be changed to use the GcalContext instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:21:59 +00:00
mindonwarp 059d72499f core: Get week start day from GcalContext
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:21:59 +00:00
mindonwarp c874bde622 refactor: Reduce code duplication in GcalContext
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:21:58 +00:00
mindonwarp 6e1330430b core: Get week start day from settings portal
Uses the already available settings portal in GcalContext to fetch and
track changes in global "week start day" desktop setting. Will use this
later to redraw views.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:21:58 +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
mindonwarp 2ef27531f4 chore: Set gsettings-desktop-schemas dep to 50.alpha
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
2026-09-26 17:21:57 +00:00
Zelda Ahmed bff0f6dac1 views/agenda: Drop GcalAgendaViewDayRow
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 11ef9db5c2 views/agenda: Rework scrolling to use gtk_list_view_scroll_to
Since we refactored all events widgets and date headers to be
constructed by GtkListView directly, we are able to use
`gtk_list_view_scroll_to` to jump to the top of the list when opening
the agenda view, and changing date, instead of needing a complicated
timer and GSource callback

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 3fe8eadcd9 theme/css: Adjust agenda view CSS
Tweak CSS to target the event widget rows/headers in the listview
directly, rather then the `GcalAgendaViewDayRow`'s first, which are no
longer being made by the agenda view's listview

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 7694e9846d views/agenda: Use ListView factories for creating the date headers
Similar to the previous commit, we now create the date header label
using the model provided directly from `ListView:header-factory`, by
querying the date of the day the item is in the section of.

This requires copying the auxiliary method `new_date_header_string ()`
from `gcal-agenda-view-day-item.c` to `gcal-agenda-view.c` for
generating the appropriate using facing string for the header

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00