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
2025-04-04 23:59:13 +00:00
2019-05-04 12:05:39 -03:00
2018-07-31 12:35:56 -03:00
2012-04-25 23:56:34 -04:00
2026-09-13 17:47:34 -03:00
2026-09-13 17:37:54 -03:00
2026-03-12 01:02:30 -04:00

GNOME Calendar

Manage your schedule

Installation

Flatpak

Contributing

For information on how to contribute, please check CONTRIBUTING.md and HACKING.md.

S
Description
No description provided
Readme
19 MiB
Languages
C 97.6%
Meson 1.2%
CSS 0.7%
Python 0.3%
Shell 0.2%