Commit Graph
6055 Commits
Author SHA1 Message Date
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
Georges Basile Stavracas Neto c1b689dbda gui/event-widget: Protect against NULL events
GcalEventWidget was adjusted to handle NULL events so it could
more easily be used in GtkListView & family, however, what was
left out of thie adjustment were the functions related to the
orientation of the event.

Protect these functions by only running them when an event widget
is around.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 55d9cc68bc views/agenda: Use ListView item factory for creating event widgets
Instead of having the `GtkListView` create a row for each day containing
their own internal `GtkListBox` to store the event widgets, move the
creation of event widgets to the `GtkListView`'s item factory.

The motivation for this change is having internal listbox's inside a
`GtkListView` is problematic for keyboard navigation, because the user
can either:

- The event widgets in the internal listbox's can not be activated by
  pressing Space/Enter on a focused event widget if the listbox row's are set to be focusable.
- If the internal listbox's rows are set to be unfocusable, the user is
  not able to navigate the event widgets using the arrow keys, Page
  Up/Down or Home/End.

To use `GtkListView:factory` to generate the event widgets, we first
wrap the filtered day model inside the list view around a
`GtkFlattenListModel` to concatenate all the containing
`GcalAgendaViewItem` (which contain a given event and the date it occurs
on) in the day models together. This gives us a model of all events that
can be turned into event widgets, and a model of day sections to create
headers for each day in the next commit.

This approach was taken because we do not get the activated row widget,
unlike with the previously used `GtkListBox` where the row widget is
passed as an argument in `::row-activated`, and there is no feasible
other way to obtain the correct event widget from a `GtkListView`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 3f1bc3edf0 view/agenda-view-day: Use a map model to create GcalAgendaViewItems for each event of the day
Required some small changes to `gcal-agenda-day-row.c` to keep the
application working - `create_day_row_func` was tweaked to query the
given item for the event, instead of assuming the event is the item
itself. This will be removed (alongside the rest of GcalAgendaDayRow) in
a later commit

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Zelda Ahmed 4ea2fcfcbe guis/views: Introduce GcalAgendaViewItem
GcalAgendaViewItem is an auxiliary object that will be used instead of
the raw events by GcalAgendaViewDay in a later commit to construct the
event widgets inside the main ListView of the agenda view as opposed to
a creating them inside of a `GtkListBox` inside each row of the
ListView.

Holding a reference to the event widget will be necessary in later
commits, so when a ListView row is activated, we can query its model of
GcalAgendaViewItem's with the given activated position, and pass the
correct item's event widget to `gcal_view_event_activated ()`

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
2026-09-26 13:02:27 +01:00
Martin a6ede83217 Update Slovenian translation 2026-09-26 10:56:13 +00:00
Niklas Wimmer cf0a0835c1 calendar-management: Reduce online page to online calendars
Removes all UI and logic for local calendars from the
new-online-calendar page. This is now handled by the
new-local-calendar page.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 85ec836d04 calendar-management: Reduce local page to local calendars
Removes all UI and logic for online calendars from the
new-local-calendar page. This is now handled by the
new-online-calendar page.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Titouan Real 8a21b82e42 calendar-management: Replace bottom button with menu
The new menu allows opening either the new-local-calendar or the
new-online-calendar page. As of this commit both pages still show
the same content, this will be fixed in the following commits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 736b724d24 calendar-management: Remove new-calendar page
This page will be replaced by the two pages created in the previous
commits, new-local-calendar and new-online-calendar.

To keep the project compiling the button to add a new calendar now
temporarily points at new-local-calendar. The button will be replaced
by a menu exposing both new pages in one of the following commits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 06910d9a89 calendar-management: Add new-online-calendar page
This is a copy of the existing new-calendar page, but with a
different class name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 4a5211b7a8 calendar-management: Add new-local-calendar page
This is a copy of the existing new-calendar page, but with a
different class name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
ARAKHNID ff2689b0f2 gui/event-editor/date-time-chooser: Exit if 12-hour time entry is invalid
If the user has 12h time and sets a properly formatted but invalid time,
Calendar would crash because `date_time` would be `NULL`. This would
specifically happen if the time was set over 23:59 AM or 11:59 PM (ex:
19:00 PM).

By breaking if `date_time` is `NULL`, the crash can be avoided.

Closes #1602

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/848>
2026-09-25 23:55:31 +00:00
Hari Rana bf8e9929e3 views/month-cell: Unstyle cells when overflow button is focused
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/835>
2026-09-25 19:13:29 +00:00
Hari Rana 02ad105088 views/month-view: Avoid selecting cells when pressing overflow button
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/835>
2026-09-25 19:13:29 +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 7c65f6a0ff event-editor/multi-choice: Remove margins
The margins applied in CSS caused some issues with alignment,
specifically in popovers where they would make the popover
wider than needed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana 05ec02fadb event-editor/multi-choice: Replace GtkToggleButton with AdwBin
Using GtkToggleButton in this case is not only overkill for our
intended use case, it is also a hinderance, as the states and focus
of the widget are handled by the widget itself, which can lead to
unpredictable and undesired behavior.

Using AdwBin solves this problem by allowing us to set the styles
and states from the parent, provided that the CSS name is changed
to "button". Switching to AdwBin also allows us to not override the
`focus()`, `grab_focus()`, and `get_platform_state()` virtual methods.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana 1748014028 event-editor/multi-choice: Consolidate state flag changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana c3d5c777ec event-editor/multi-choice: Port from GtkEventControllerKey to shortcuts
Since we wrap the values all the time now, this also removes
the `gtk_widget_error_bell()` call.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:11 +00:00
Hari Rana 34be5e4663 event-editor/multi-choice: Inherit GtkWidget
This is a prerequisite for removing the strong dependence on the
child GtkToggleButton widget, removing the platform state override,
and adding binding actions in later commits.

Inheriting AdwBin was attempted but it didn't work, as AdwBin
presumably messes with focusability and activation, making
it insufficient for this use case.

`hexpand=true` needs to be explicitly set.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:10 +00:00
Hari Rana f20c9235ce event-editor/multi-choice: Port to GtkPopoverBin
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:10 +00:00
Marcel Mrówka 68b93fb507 Update Polish translation
Co-authored-by: Marcel Mrówka <micro.mail88@gmail.com>
Reviewed-by: Victoria Niedzielska <victorian@gnome.org>
2026-09-25 18:07:54 +00:00
Hugo Carvalho fca8c93001 Update Portuguese translation
(cherry picked from commit 05beaf1715ce194a685ebaed1bb4d1423948c8b4)
2026-09-25 10:12:14 +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 38ad6ea3ea utils: Remove unused functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:23 +00:00
Roy-Magne Mo 7ded29fe39 Update Norwegian Nynorsk translation
(cherry picked from commit 57e14600b0e9d56808810a85ca4269e21d32a11c)
2026-09-19 19:43:16 +00:00
Hari Rana 307f4e78e7 event-editor/multi-choice: Use standard enum members in properties
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 15:07:03 -04:00
Hari Rana 99463b9a62 event-editor/multi-choice: Set accessible label without connecting signal
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:05 -04:00
Hari Rana 2bab7bdc3a event-editor/multi-choice: Remove animate property
We no longer use this property. Removing it will then allow us to
directly set the label without having to use GtkStack, but this
will be done in a later commit.

This also sets all transitions to "none".

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:05 -04:00
Hari Rana 3185997f38 event-editor/multi-choice: Remove wrap property
We no longer have a use case which requires us to keep the
`wrap` property to FALSE, so this patch removes that property
while keeping the wrap behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04: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 b8e06d32a1 event-editor/multi-choice: Remove unused overrides
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana 14c20483ae event-editor/multi-choice: Use G_DEFINE_FINAL_TYPE_WITH_CODE()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:01 -04:00
Hari Rana 0d1d339581 views: Document transfer none in gcal_view_set_date()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/838>
2026-09-19 09:12:05 -04:00
Hari Rana 2f393ab117 views/month-view: Free GDateTime when setting active date
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/838>
2026-09-19 09:08:56 -04:00
Roy-Magne Mo df23a422cc Update Norwegian Nynorsk translation
(cherry picked from commit 495344b13dbd6ce0a40a204de0c44f7b66c7eb10)
2026-09-19 11:10:13 +00:00
Alen b4f4d6b588 Update Bosnian translation 2026-09-18 18:24:53 +00:00
Quentin PAGÈS 666846d9c0 Update Occitan translation 2026-09-17 15:41:25 +00: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