This is a major rework of the Agenda view. It splits the view into GcalAgendaViewDay, which represent a single day with events; and GcalAgendaViewDayRow, which is the actual widget with a title label, and a listbox with event widgets. The Agenda view itself merely manages a list of GcalAgendaViewDays, and updates them with the events model, and active dates. This allows us to get rid of the custom listbox row, and the confusing checks for event widgets, and all the bugs the came with it. It also allows for removing the internal GcalRangeTree, and delegate all event management to list models. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
36 lines
639 B
Plaintext
36 lines
639 B
Plaintext
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
template $GcalAgendaViewDayRow: Adw.Bin {
|
|
Box {
|
|
orientation: vertical;
|
|
|
|
Label title_label {
|
|
xalign: 0.0;
|
|
label: bind $datetime_to_string_func(template.day as <$GcalAgendaViewDay>.date);
|
|
|
|
styles [
|
|
"caption-heading",
|
|
]
|
|
}
|
|
|
|
ListBox listbox {
|
|
hexpand: true;
|
|
vexpand: true;
|
|
selection-mode: none;
|
|
row-activated => $on_list_box_row_activated_cb(template) not-swapped;
|
|
|
|
[placeholder]
|
|
Label {
|
|
label: _("No events");
|
|
xalign: 0;
|
|
|
|
styles [
|
|
"no-events",
|
|
"dimmed",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|