Read-only events show a "Done" button instead of the "Save" button. The "Done" button does the same thing as "Cancel", so the "Cancel" button is then redundant. Likewise, it is impossible to delete events from read-only calendars, as stated by the banner message in that dialog. In that case, there's no reason to show a big "Delete" button that you can't click on. Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1168
108 lines
2.2 KiB
Plaintext
108 lines
2.2 KiB
Plaintext
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;
|
|
title: _("Delete Event");
|
|
|
|
styles [
|
|
"destructive-action",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
ShortcutController {
|
|
Shortcut {
|
|
trigger: "<Control>s";
|
|
action: "action(event-editor.save)";
|
|
}
|
|
}
|
|
}
|
|
|
|
SizeGroup {
|
|
mode: vertical;
|
|
|
|
widgets [
|
|
cancel_button,
|
|
done_button,
|
|
]
|
|
}
|