diff --git a/src/gui/event-editor/gcal-event-editor-dialog.blp b/src/gui/event-editor/gcal-event-editor-dialog.blp index b43ae4cf..8fa15ad5 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.blp +++ b/src/gui/event-editor/gcal-event-editor-dialog.blp @@ -61,12 +61,9 @@ template $GcalEventEditorDialog: Adw.Dialog { } } - Adw.PreferencesGroup { + $GcalRemindersSection reminders_section { title: _("Reminders"); - - $GcalRemindersSection reminders_section { - sensitive: bind template.writable; - } + sensitive: bind template.writable; } $GcalNotesSection notes_section { diff --git a/src/gui/event-editor/gcal-reminders-section.blp b/src/gui/event-editor/gcal-reminders-section.blp index a218dc2e..5a35e2e7 100644 --- a/src/gui/event-editor/gcal-reminders-section.blp +++ b/src/gui/event-editor/gcal-reminders-section.blp @@ -1,9 +1,7 @@ using Gtk 4.0; using Adw 1; -template $GcalRemindersSection: Box { - orientation: vertical; - +template $GcalRemindersSection: Adw.PreferencesGroup { ListBox alarms_listbox { selection-mode: none; row-activated => $on_alarms_listbox_row_activated_cb(template) not-swapped; diff --git a/src/gui/event-editor/gcal-reminders-section.c b/src/gui/event-editor/gcal-reminders-section.c index ff0ff76f..9f81572b 100644 --- a/src/gui/event-editor/gcal-reminders-section.c +++ b/src/gui/event-editor/gcal-reminders-section.c @@ -30,7 +30,7 @@ struct _GcalRemindersSection { - GtkBox parent; + AdwPreferencesGroup parent; GtkListBox *alarms_listbox; GtkWidget *alarms_popover; @@ -60,7 +60,7 @@ static void on_remove_alarm_cb (GcalAlarmRow static void on_update_alarm_cb (GcalAlarmRow *alarm_row, GcalRemindersSection *self); -G_DEFINE_TYPE_WITH_CODE (GcalRemindersSection, gcal_reminders_section, GTK_TYPE_BOX, +G_DEFINE_TYPE_WITH_CODE (GcalRemindersSection, gcal_reminders_section, ADW_TYPE_PREFERENCES_GROUP, G_IMPLEMENT_INTERFACE (GCAL_TYPE_EVENT_EDITOR_SECTION, gcal_event_editor_section_iface_init)) /* diff --git a/src/gui/event-editor/gcal-reminders-section.h b/src/gui/event-editor/gcal-reminders-section.h index 202a8c08..7925b90e 100644 --- a/src/gui/event-editor/gcal-reminders-section.h +++ b/src/gui/event-editor/gcal-reminders-section.h @@ -20,11 +20,11 @@ #pragma once -#include +#include G_BEGIN_DECLS #define GCAL_TYPE_REMINDERS_SECTION (gcal_reminders_section_get_type()) -G_DECLARE_FINAL_TYPE (GcalRemindersSection, gcal_reminders_section, GCAL, REMINDERS_SECTION, GtkBox) +G_DECLARE_FINAL_TYPE (GcalRemindersSection, gcal_reminders_section, GCAL, REMINDERS_SECTION, AdwPreferencesGroup) G_END_DECLS