27 Commits
Author SHA1 Message Date
Zelda Ahmed 5a23ab940f views/agenda-item: Drop event widget property and methods
In the end, we did not need to store the event widget in the item to be
able to activate it, so this code can be dropped completely.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/866>
2026-10-04 16:31:38 +01:00
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
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
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
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
Zelda Ahmed 30f1849dcd Update POTFILES with gcal-notes-section.blp
`gcal-notes-section.blp` now contains a string that needs translating but I
forgot to add the file to POTFILES in the original MR at
https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/714

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/826>
2026-09-05 10:07:16 +00:00
Zelda Ahmed dbb786d0e8 tests/range: Add bug base URL
Every other unit test included a link to calendar's bug reporting except
test-range.c, so lets include that

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/820>
2026-08-29 10:48:24 +01:00
Zelda Ahmed c1549d59fa gui/event-popover: Use en-dash instead of em-dash for date ranges
En-dashes "–" should be used instead of the longer em-dashes "—", since
the dash was used to represent a range of dates, which means the correct
dash to use is the en-dash

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/789>
2026-06-29 16:44:23 +01:00
Zelda Ahmed b29cf4e517 core/event: Use en-dash instead of em-dash
En-dashes "–" should be used instead of the longer em-dashes "—", since
the dash was used to represent a range of dates, which means the correct
dash to use is the en-dash

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/789>
2026-06-29 16:44:18 +01:00
Zoey Ahmed fbfacb6972 gui/blueprint: Drop unneeded casts to built-ins
Blueprint can now "infer" the type a closure returns, as long as it is
not the property of a custom GType, so some of the casts (e.g. `as
<string>`) will not be necessary anymore

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/733>
2026-03-24 16:43:10 +00:00
Zoey Ahmed 2300ed29cd notes: Add placeholder text if notes section empty
Move the textview box into an overlay, with a label as the overlay
child,
that appears only when the textview is empty, and remove the "Notes"
title for the preference group with the notes row in the event dialog.

This better indicates the notes is an input field to the user, compared
to the design before.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1081
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/714>
2026-03-23 18:25:12 +00:00
Zoey Ahmed f99678aea9 views/month-view: Check if focused widget is month cell
This fixes an issue where pressing Shift + Up/Down while focused on the
overflow button will result in a bail out when asserting the focused
widget has a month cell ancestor:

```
GcalMonthView:ERROR:../src/gui/views/gcal-month-view.c:1002:on_key_controller_key_pressed_cb: assertion failed: (GCAL_IS_MONTH_CELL (month_cell))
Bail out! GcalMonthView:ERROR:../src/gui/views/gcal-month-view.c:1002:on_key_controller_key_pressed_cb: assertion failed: (GCAL_IS_MONTH_CELL (month_cell))
```

When navigating between month cells with a keyboard, focus is set
on respective month cells, so checking whether the ancestor
is a month cell or not is not only unnecessary, it also causes
bugs like the assertion above.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/720>
2026-03-11 08:55:09 -04: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 42595e4a65 multi-choice: Add prop for category name
This will be binded to both the accessibility label for each multi choice,
as opposed to defining it in GcalDateChooser 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
Zoey Ahmed a38bcf9b68 month-cell: Fix accessibility warnings
* Add a tooltip to the overflow button.
* Change weather icon to have use the presentation accessible role

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1522
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/681>
2026-01-29 02:21:42 +00:00
Zoey Ahmed c3635967bc window: Go back/forth views using hardware buttons
Refactor `on_window_previous_date_activated_cb` and
`on_window_next_date_activated_cb` into separate methods for going to
the prev/next view, to be used in the callbacks for both the
forward/back buttons in the UI, and for the `Gtk.GestureClick` callbacks
that listens for the hardware buttons to be pressed.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1494
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/682>
2026-01-15 17:02:17 +00:00
Zoey 1c7760bd89 Reuse day_of_month to check if date of month is 1 2025-05-01 18:27:05 +01:00