diff --git a/src/gui/event-editor/gcal-attendees-section.blp b/src/gui/event-editor/gcal-attendees-section.blp index a7d0170a..1b448987 100644 --- a/src/gui/event-editor/gcal-attendees-section.blp +++ b/src/gui/event-editor/gcal-attendees-section.blp @@ -1,33 +1,20 @@ using Gtk 4.0; +using Adw 1; -template $GcalAttendeesSection: Gtk.Box { - orientation: vertical; - hexpand: true; - valign: start; +template $GcalAttendeesSection: Adw.PreferencesGroup { + $GcalOrganizerRow organizer_row { + organizer: bind template.organizer; + } - ListBox listbox { - halign: fill; - valign: fill; - selection-mode: none; + $GcalAttendeeSummaryRow summary_row { + title: _("Participants"); + attendees: bind template.attendees; + filter-flags: GCAL_EVENT_ATTENDEE_TYPE_FILTER_PERSON; + } - styles [ - "boxed-list", - ] - - $GcalOrganizerRow organizer_row { - organizer: bind template.organizer; - } - - $GcalAttendeeSummaryRow summary_row { - title: _("Participants"); - attendees: bind template.attendees; - filter-flags: GCAL_EVENT_ATTENDEE_TYPE_FILTER_PERSON; - } - - $GcalAttendeeSummaryRow { - title: _("Resources"); - attendees: bind template.attendees; - filter-flags: GCAL_EVENT_ATTENDEE_TYPE_FILTER_RESOURCE; - } + $GcalAttendeeSummaryRow { + title: _("Resources"); + attendees: bind template.attendees; + filter-flags: GCAL_EVENT_ATTENDEE_TYPE_FILTER_RESOURCE; } } diff --git a/src/gui/event-editor/gcal-attendees-section.c b/src/gui/event-editor/gcal-attendees-section.c index 4a86ad20..760c1bc2 100644 --- a/src/gui/event-editor/gcal-attendees-section.c +++ b/src/gui/event-editor/gcal-attendees-section.c @@ -32,7 +32,7 @@ struct _GcalAttendeesSection { - GtkBox parent_instance; + AdwPreferencesGroup parent_instance; GcalEvent *event; GcalEventOrganizer *organizer; @@ -44,7 +44,7 @@ struct _GcalAttendeesSection static void gcal_event_editor_section_init_iface (GcalEventEditorSectionInterface *iface); -G_DEFINE_FINAL_TYPE_WITH_CODE (GcalAttendeesSection, gcal_attendees_section, GTK_TYPE_BOX, +G_DEFINE_FINAL_TYPE_WITH_CODE (GcalAttendeesSection, gcal_attendees_section, ADW_TYPE_PREFERENCES_GROUP, G_IMPLEMENT_INTERFACE (GCAL_TYPE_EVENT_EDITOR_SECTION, gcal_event_editor_section_init_iface)) enum diff --git a/src/gui/event-editor/gcal-attendees-section.h b/src/gui/event-editor/gcal-attendees-section.h index ca78b0f4..a6840cb9 100644 --- a/src/gui/event-editor/gcal-attendees-section.h +++ b/src/gui/event-editor/gcal-attendees-section.h @@ -18,12 +18,11 @@ #pragma once -#include -#include +#include G_BEGIN_DECLS #define GCAL_TYPE_ATTENDEES_SECTION (gcal_attendees_section_get_type ()) -G_DECLARE_FINAL_TYPE (GcalAttendeesSection, gcal_attendees_section, GCAL, ATTENDEES_SECTION, GtkBox) +G_DECLARE_FINAL_TYPE (GcalAttendeesSection, gcal_attendees_section, GCAL, ATTENDEES_SECTION, AdwPreferencesGroup) G_END_DECLS diff --git a/src/gui/event-editor/gcal-event-editor-dialog.blp b/src/gui/event-editor/gcal-event-editor-dialog.blp index 8fa15ad5..7d1b6274 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.blp +++ b/src/gui/event-editor/gcal-event-editor-dialog.blp @@ -55,10 +55,8 @@ template $GcalEventEditorDialog: Adw.Dialog { } } - Adw.PreferencesGroup participants_group { - $GcalAttendeesSection attendees_section { - sensitive: bind template.writable; - } + $GcalAttendeesSection attendees_section { + sensitive: bind template.writable; } $GcalRemindersSection reminders_section { diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index 0f74ee7c..85cacf58 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.c +++ b/src/gui/event-editor/gcal-event-editor-dialog.c @@ -64,7 +64,6 @@ struct _GcalEventEditorDialog GtkWidget *source_label; GcalEventEditorSection *summary_section; GcalEventEditorSection *attendees_section; - GtkWidget *participants_group; GtkWidget *nav_view; GtkWidget *main_page; GtkWidget *attendee_details_page; @@ -591,7 +590,6 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass) gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, schedule_section); gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, summary_section); gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, attendees_section); - gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, participants_group); gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, nav_view); gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, main_page); gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, attendee_details_page); @@ -691,7 +689,7 @@ gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self, set_writable (self, !gcal_calendar_is_read_only (calendar)); gboolean has_participants = gcal_event_get_organizer (self->event) != NULL; - gtk_widget_set_visible (GTK_WIDGET (self->participants_group), has_participants); + gtk_widget_set_visible (GTK_WIDGET (self->attendees_section), has_participants); gtk_widget_set_visible (self->cancel_button, self->writable);