event-editor/event-editor-dialog: Port to AdwPreferencesPage

Our use case is already handled by the `AdwPreferencesPage:banner`
property, which allows us to port the dialog to AdwPreferencesPage.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
This commit is contained in:
Hari Rana
2026-06-23 14:10:34 -04:00
parent 4f037132fe
commit 568227346b
@@ -31,66 +31,60 @@ template $GcalEventEditorDialog: Adw.Dialog {
} }
} }
content: Box { content: Adw.PreferencesPage {
orientation: vertical; banner: Adw.Banner {
Adw.Banner {
title: _("This event is in a read-only calendar. It cannot be edited or deleted."); title: _("This event is in a read-only calendar. It cannot be edited or deleted.");
revealed: bind template.writable inverted; revealed: bind template.writable inverted;
};
Adw.PreferencesGroup {
$GcalSummarySection summary_section {
sensitive: bind template.writable;
}
} }
Adw.PreferencesPage { Adw.PreferencesGroup {
vexpand: true; $GcalCalendarComboRow calendar_combo_row {
sensitive: bind template.writable;
Adw.PreferencesGroup {
$GcalSummarySection summary_section {
sensitive: bind template.writable;
}
} }
}
Adw.PreferencesGroup { Adw.PreferencesGroup {
$GcalCalendarComboRow calendar_combo_row { $GcalScheduleSection schedule_section {
sensitive: bind template.writable; sensitive: bind template.writable;
}
} }
}
Adw.PreferencesGroup { Adw.PreferencesGroup participants_group {
$GcalScheduleSection schedule_section { $GcalAttendeesSection attendees_section {
sensitive: bind template.writable; sensitive: bind template.writable;
}
} }
}
Adw.PreferencesGroup participants_group { Adw.PreferencesGroup {
$GcalAttendeesSection attendees_section { title: _("Reminders");
sensitive: bind template.writable;
} $GcalRemindersSection reminders_section {
sensitive: bind template.writable;
} }
}
Adw.PreferencesGroup { Adw.PreferencesGroup {
title: _("Reminders"); $GcalNotesSection notes_section {
sensitive: bind template.writable;
$GcalRemindersSection reminders_section { vexpand: true;
sensitive: bind template.writable;
}
} }
}
Adw.PreferencesGroup { Adw.PreferencesGroup delete_group {
$GcalNotesSection notes_section { Adw.ButtonRow {
sensitive: bind template.writable; activated => $on_delete_row_activated_cb(template) not-swapped;
vexpand: true; title: _("_Delete Event");
} use-underline: true;
}
Adw.PreferencesGroup delete_group { styles [
Adw.ButtonRow { "destructive-action",
activated => $on_delete_row_activated_cb(template) not-swapped; ]
title: _("_Delete Event");
use-underline: true;
styles [
"destructive-action",
]
}
} }
} }
}; };