gui: Port to Blueprint

This was mostly done with `blueprint-compiler port`.

Since Blueprint doesn't know about custom templates, I had to manually change some values from strings to literals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/567>
This commit is contained in:
Jamie Gravendeel
2025-06-08 14:31:01 +02:00
parent 2aceaa816f
commit a509de8b1e
90 changed files with 3278 additions and 3867 deletions
@@ -0,0 +1,108 @@
using Gtk 4.0;
using Adw 1;
template $GcalEventEditorDialog: Adw.Dialog {
content-width: 700;
content-height: 1000;
Adw.ToolbarView {
[top]
Adw.HeaderBar {
show-start-title-buttons: false;
show-end-title-buttons: false;
Button cancel_button {
use-underline: true;
label: _("_Cancel");
clicked => $on_cancel_button_clicked_cb(template) not-swapped;
}
[end]
Button done_button {
use-underline: true;
label: _("_Done");
action-name: "event-editor.save";
styles [
"suggested-action",
]
}
}
content: Box {
orientation: vertical;
Adw.Banner {
title: _("This event is in a read-only calendar. It cannot be edited or deleted.");
revealed: bind template.writable inverted;
}
Adw.PreferencesPage {
vexpand: true;
Adw.PreferencesGroup {
$GcalSummarySection summary_section {
sensitive: bind template.writable;
}
}
Adw.PreferencesGroup {
$GcalCalendarComboRow calendar_combo_row {
sensitive: bind template.writable;
}
}
Adw.PreferencesGroup {
$GcalScheduleSection schedule_section {
sensitive: bind template.writable;
}
}
Adw.PreferencesGroup {
title: _("Reminders");
$GcalRemindersSection reminders_section {
sensitive: bind template.writable;
}
}
Adw.PreferencesGroup {
title: _("Notes");
$GcalNotesSection notes_section {
sensitive: bind template.writable;
vexpand: true;
}
}
Adw.PreferencesGroup delete_group {
Adw.ButtonRow {
activated => $on_delete_row_activated_cb(template) not-swapped;
sensitive: bind template.writable no-sync-create;
title: _("Delete Event");
styles [
"destructive-action",
]
}
}
}
};
}
ShortcutController {
Shortcut {
trigger: "<Control>s";
action: "action(event-editor.save)";
}
}
}
SizeGroup {
mode: vertical;
widgets [
cancel_button,
done_button,
]
}