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:
@@ -0,0 +1,27 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalAlarmRow: Adw.ActionRow {
|
||||
ToggleButton volume_button {
|
||||
valign: center;
|
||||
icon-name: "audio-volume-high-symbolic";
|
||||
tooltip-text: _("Toggle Alarm Sound");
|
||||
notify::active => $on_sound_toggle_changed_cb(template) not-swapped;
|
||||
active: true;
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
|
||||
Button remove_button {
|
||||
valign: center;
|
||||
icon-name: "edit-delete-symbolic";
|
||||
tooltip-text: _("Remove Alarm");
|
||||
clicked => $on_remove_button_clicked_cb(template) not-swapped;
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalAlarmRow" parent="AdwActionRow">
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="volume_button">
|
||||
<property name="valign">center</property>
|
||||
<property name="icon-name">audio-volume-high-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Toggle Alarm Sound</property>
|
||||
<signal name="notify::active" handler="on_sound_toggle_changed_cb" object="GcalAlarmRow" swapped="no" />
|
||||
<property name="active">yes</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="remove_button">
|
||||
<property name="valign">center</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Remove Alarm</property>
|
||||
<signal name="clicked" handler="on_remove_button_clicked_cb" object="GcalAlarmRow" swapped="no" />
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,39 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalDateChooserRow: Adw.EntryRow {
|
||||
EventControllerFocus {
|
||||
notify::contains-focus => $on_contains_focus_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
MenuButton {
|
||||
icon-name: "calendar-month-symbolic";
|
||||
valign: center;
|
||||
tooltip-text: _("Edit Date");
|
||||
|
||||
popover: Popover {
|
||||
position: bottom;
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
|
||||
$GcalDateChooser date_chooser {
|
||||
show-events: false;
|
||||
show-selected-week: false;
|
||||
show-week-numbers: true;
|
||||
day-selected => $on_date_selected_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
show => $on_date_popover_shown_cb(template) not-swapped;
|
||||
};
|
||||
|
||||
accessibility {
|
||||
label: _("Edit date");
|
||||
}
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalDateChooserRow" parent="AdwEntryRow">
|
||||
|
||||
<child>
|
||||
<object class="GtkEventControllerFocus">
|
||||
<signal name="notify::contains-focus" handler="on_contains_focus_changed_cb" object="GcalDateChooserRow" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">calendar-month-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Edit Date</property>
|
||||
<property name="popover">
|
||||
<object class="GtkPopover">
|
||||
<property name="position">bottom</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="GcalDateChooser" id="date_chooser">
|
||||
<property name="show_events">False</property>
|
||||
<property name="show_selected_week">False</property>
|
||||
<property name="show_week_numbers">True</property>
|
||||
<signal name="day-selected" handler="on_date_selected_changed_cb" object="GcalDateChooserRow" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<signal name="show" handler="on_date_popover_shown_cb" object="GcalDateChooserRow" swapped="no" />
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<accessibility>
|
||||
<property name="label" translatable="yes">Edit date</property>
|
||||
</accessibility>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,28 @@
|
||||
using Gtk 4.0;
|
||||
|
||||
template $GcalDateSelector: Entry {
|
||||
width-chars: 11;
|
||||
max-width-chars: 11;
|
||||
secondary-icon-name: "pan-down-symbolic";
|
||||
input-hints: no_emoji;
|
||||
icon-press => $icon_pressed_cb(template) not-swapped;
|
||||
|
||||
EventControllerFocus {
|
||||
notify::contains-focus => $on_contains_focus_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
Popover date_selector_popover {
|
||||
position: bottom;
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
|
||||
$GcalDateChooser date_chooser {
|
||||
show-events: false;
|
||||
show-selected-week: false;
|
||||
show-week-numbers: true;
|
||||
day-selected => $calendar_day_selected(template);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalDateSelector" parent="GtkEntry">
|
||||
<property name="width-chars">11</property>
|
||||
<property name="max-width-chars">11</property>
|
||||
<property name="secondary-icon-name">pan-down-symbolic</property>
|
||||
<property name="input-hints">no-emoji</property>
|
||||
<signal name="icon-press" handler="icon_pressed_cb" object="GcalDateSelector" swapped="no"/>
|
||||
|
||||
<child>
|
||||
<object class="GtkEventControllerFocus">
|
||||
<signal name="notify::contains-focus" handler="on_contains_focus_changed_cb" object="GcalDateSelector" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkPopover" id="date_selector_popover">
|
||||
<property name="position">bottom</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<child>
|
||||
<object class="GcalDateChooser" id="date_chooser">
|
||||
<property name="show_events">False</property>
|
||||
<property name="show_selected_week">False</property>
|
||||
<property name="show_week_numbers">True</property>
|
||||
<signal name="day-selected" handler="calendar_day_selected" object="GcalDateSelector" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,125 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalDateTimeChooser: Adw.PreferencesGroup {
|
||||
$GcalDateChooserRow date_row {
|
||||
title: _("Date");
|
||||
notify::date => $on_date_changed_cb(template);
|
||||
}
|
||||
|
||||
Adw.EntryRow time_row {
|
||||
title: _("Time");
|
||||
|
||||
EventControllerFocus {
|
||||
notify::contains-focus => $on_time_row_contains_focus_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
MenuButton {
|
||||
icon-name: "clock-alt-symbolic";
|
||||
valign: center;
|
||||
tooltip-text: _("Edit Time");
|
||||
|
||||
popover: Popover time_popover {
|
||||
position: bottom;
|
||||
|
||||
Box {
|
||||
spacing: 15;
|
||||
margin-top: 6;
|
||||
margin-bottom: 6;
|
||||
margin-start: 6;
|
||||
margin-end: 6;
|
||||
orientation: vertical;
|
||||
|
||||
Box {
|
||||
spacing: 12;
|
||||
halign: center;
|
||||
orientation: horizontal;
|
||||
|
||||
Box {
|
||||
spacing: 6;
|
||||
halign: center;
|
||||
|
||||
SpinButton {
|
||||
xalign: 0.5;
|
||||
orientation: vertical;
|
||||
adjustment: hour_adjustment;
|
||||
wrap: true;
|
||||
output => $on_spin_button_output_cb(template) not-swapped;
|
||||
wrapped => $on_hour_spin_button_wrapped_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
Label {
|
||||
label: _(":");
|
||||
}
|
||||
|
||||
SpinButton {
|
||||
xalign: 0.5;
|
||||
orientation: vertical;
|
||||
adjustment: minute_adjustment;
|
||||
wrap: true;
|
||||
output => $on_spin_button_output_cb(template) not-swapped;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ToggleGroup period_toggle_group {
|
||||
visible: false;
|
||||
valign: center;
|
||||
active-name: "am";
|
||||
|
||||
Adw.Toggle {
|
||||
label: _("AM");
|
||||
name: "am";
|
||||
}
|
||||
|
||||
Adw.Toggle {
|
||||
label: _("PM");
|
||||
name: "pm";
|
||||
}
|
||||
|
||||
notify::active => $on_period_toggle_group_active_changed_cb();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
valign: center;
|
||||
tooltip-text: _("Change Timezone");
|
||||
|
||||
Adw.ButtonContent time_zone_button_content {
|
||||
icon-name: "globe-symbolic";
|
||||
}
|
||||
|
||||
clicked => $on_time_zone_button_clicked_cb(template) not-swapped;
|
||||
|
||||
accessibility {
|
||||
label: _("Change Timezone");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show => $on_time_popover_shown_cb(template) not-swapped;
|
||||
};
|
||||
|
||||
accessibility {
|
||||
label: _("Edit time");
|
||||
}
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adjustment hour_adjustment {
|
||||
upper: 23;
|
||||
step-increment: 1;
|
||||
page-increment: 5;
|
||||
value-changed => $on_spin_buttons_value_changed_cb(template);
|
||||
}
|
||||
|
||||
Adjustment minute_adjustment {
|
||||
upper: 59;
|
||||
step-increment: 1;
|
||||
page-increment: 10;
|
||||
value-changed => $on_spin_buttons_value_changed_cb(template);
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<interface>
|
||||
<template class="GcalDateTimeChooser" parent="AdwPreferencesGroup">
|
||||
|
||||
<child>
|
||||
<object class="GcalDateChooserRow" id="date_row">
|
||||
<property name="title" translatable="yes">Date</property>
|
||||
<signal name="notify::date" handler="on_date_changed_cb" object="GcalDateTimeChooser" swapped="yes" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwEntryRow" id="time_row">
|
||||
<property name="title" translatable="yes">Time</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkEventControllerFocus">
|
||||
<signal name="notify::contains-focus" handler="on_time_row_contains_focus_changed_cb" object="GcalDateTimeChooser" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">clock-alt-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Edit Time</property>
|
||||
<property name="popover">
|
||||
<object class="GtkPopover" id="time_popover">
|
||||
<property name="position">bottom</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">15</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="orientation">GTK_ORIENTATION_VERTICAL</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">12</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">6</property>
|
||||
<property name="halign">center</property>
|
||||
|
||||
<!-- Hour -->
|
||||
<child>
|
||||
<object class="GtkSpinButton">
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">hour_adjustment</property>
|
||||
<property name="wrap">True</property>
|
||||
<signal name="output" handler="on_spin_button_output_cb" object="GcalDateTimeChooser" swapped="no"/>
|
||||
<signal name="wrapped" handler="on_hour_spin_button_wrapped_cb" object="GcalDateTimeChooser" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">:</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Minute -->
|
||||
<child>
|
||||
<object class="GtkSpinButton">
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">minute_adjustment</property>
|
||||
<property name="wrap">True</property>
|
||||
<signal name="output" handler="on_spin_button_output_cb" object="GcalDateTimeChooser" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- AM/PM -->
|
||||
<child>
|
||||
<object class="AdwToggleGroup" id="period_toggle_group">
|
||||
<property name="visible">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active-name">am</property>
|
||||
<child>
|
||||
<object class="AdwToggle">
|
||||
<property name="label" translatable="yes">AM</property>
|
||||
<property name="name">am</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwToggle">
|
||||
<property name="label" translatable="yes">PM</property>
|
||||
<property name="name">pm</property>
|
||||
</object>
|
||||
</child>
|
||||
<signal name="notify::active" handler="on_period_toggle_group_active_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Change Timezone</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwButtonContent" id="time_zone_button_content">
|
||||
<property name="icon-name">globe-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<signal name="clicked" handler="on_time_zone_button_clicked_cb" object="GcalDateTimeChooser" swapped="no"/>
|
||||
|
||||
<accessibility>
|
||||
<property name="label" translatable="yes">Change Timezone</property>
|
||||
</accessibility>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<signal name="show" handler="on_time_popover_shown_cb" object="GcalDateTimeChooser" swapped="no" />
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<accessibility>
|
||||
<property name="label" translatable="yes">Edit time</property>
|
||||
</accessibility>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
<object class="GtkAdjustment" id="hour_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">5</property>
|
||||
<signal name="value-changed" handler="on_spin_buttons_value_changed_cb" object="GcalDateTimeChooser" swapped="yes"/>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="minute_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
<signal name="value-changed" handler="on_spin_buttons_value_changed_cb" object="GcalDateTimeChooser" swapped="yes"/>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
@@ -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,
|
||||
]
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalEventEditorDialog" parent="AdwDialog">
|
||||
<property name="content-width">700</property>
|
||||
<property name="content-height">1000</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="show-start-title-buttons">False</property>
|
||||
<property name="show-end-title-buttons">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<property name="use-underline">True</property>
|
||||
<property name="label" translatable="yes">_Cancel</property>
|
||||
<signal name="clicked" handler="on_cancel_button_clicked_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkButton" id="done_button">
|
||||
<property name="use-underline">True</property>
|
||||
<property name="label" translatable="yes">_Done</property>
|
||||
<property name="action-name">event-editor.save</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="AdwBanner">
|
||||
<property name="title" translatable="yes">This event is in a read-only calendar. It cannot be edited or deleted.</property>
|
||||
<property name="revealed" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|invert-boolean|sync-create" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwPreferencesPage">
|
||||
<property name="vexpand">True</property>
|
||||
|
||||
<!-- Summary -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="GcalSummarySection" id="summary_section">
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|sync-create" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Calendar choice -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="GcalCalendarComboRow" id="calendar_combo_row">
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|sync-create" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Schedule -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="GcalScheduleSection" id="schedule_section">
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|sync-create" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Reminders -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="title" translatable="yes">Reminders</property>
|
||||
<child>
|
||||
<object class="GcalRemindersSection" id="reminders_section">
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|sync-create" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Notes -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="title" translatable="yes">Notes</property>
|
||||
<child>
|
||||
<object class="GcalNotesSection" id="notes_section">
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default|sync-create" />
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Delete Button -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="delete_group">
|
||||
<child>
|
||||
<object class="AdwButtonRow">
|
||||
<signal name="activated" handler="on_delete_row_activated_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||
<property name="title" translatable="yes">Delete Event</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkShortcutController">
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger"><Control>s</property>
|
||||
<property name="action">action(event-editor.save)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
<object class="GtkSizeGroup">
|
||||
<property name="mode">vertical</property>
|
||||
<widgets>
|
||||
<widget name="cancel_button" />
|
||||
<widget name="done_button" />
|
||||
</widgets>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,64 @@
|
||||
using Gtk 4.0;
|
||||
|
||||
template $GcalMultiChoice: Box {
|
||||
spacing: 6;
|
||||
|
||||
Button down_button {
|
||||
icon-name: "pan-start-symbolic";
|
||||
clicked => $button_clicked_cb();
|
||||
|
||||
styles [
|
||||
"back-button",
|
||||
"circular",
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
|
||||
ToggleButton button {
|
||||
toggled => $button_toggled_cb() swapped;
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
"pill",
|
||||
"popup",
|
||||
]
|
||||
|
||||
accessibility {
|
||||
labelled-by: [
|
||||
template,
|
||||
];
|
||||
|
||||
described-by: [
|
||||
template,
|
||||
];
|
||||
}
|
||||
|
||||
Stack stack {
|
||||
hexpand: true;
|
||||
vexpand: true;
|
||||
|
||||
StackPage {
|
||||
name: "label1";
|
||||
|
||||
child: Label label1 {};
|
||||
}
|
||||
|
||||
StackPage {
|
||||
name: "label2";
|
||||
|
||||
child: Label label2 {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button up_button {
|
||||
icon-name: "pan-end-symbolic";
|
||||
clicked => $button_clicked_cb();
|
||||
|
||||
styles [
|
||||
"circular",
|
||||
"flat",
|
||||
"forward-button",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalMultiChoice" parent="GtkBox">
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="down_button">
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
<signal name="clicked" handler="button_clicked_cb"/>
|
||||
<style>
|
||||
<class name="back-button"/>
|
||||
<class name="circular"/>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="button">
|
||||
<signal name="toggled" handler="button_toggled_cb" swapped="yes"/>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
<class name="pill"/>
|
||||
<class name="popup"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation name="labelled-by">GcalMultiChoice</relation>
|
||||
<relation name="described-by">GcalMultiChoice</relation>
|
||||
</accessibility>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">label1</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel" id="label1" />
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">label2</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel" id="label2" />
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="up_button">
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
<signal name="clicked" handler="button_clicked_cb"/>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
<class name="flat"/>
|
||||
<class name="forward-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,27 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalNotesSection: Adw.PreferencesRow {
|
||||
activatable: false;
|
||||
focusable: false;
|
||||
|
||||
styles [
|
||||
"entry",
|
||||
"notes-section",
|
||||
]
|
||||
|
||||
Box {
|
||||
TextView notes_text {
|
||||
height-request: 250;
|
||||
hexpand: true;
|
||||
top-margin: 6;
|
||||
bottom-margin: 6;
|
||||
left-margin: 6;
|
||||
right-margin: 6;
|
||||
sensitive: true;
|
||||
wrap-mode: word_char;
|
||||
accepts-tab: false;
|
||||
state-flags-changed => $on_notes_text_state_flags_changed_cb(template) not-swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalNotesSection" parent="AdwPreferencesRow">
|
||||
<property name="activatable">False</property>
|
||||
<property name="focusable">False</property>
|
||||
|
||||
<style>
|
||||
<class name="entry" />
|
||||
<class name="notes-section" />
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
|
||||
<child>
|
||||
<object class="GtkTextView" id="notes_text">
|
||||
<property name="height-request">250</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="top_margin">6</property>
|
||||
<property name="bottom_margin">6</property>
|
||||
<property name="left_margin">6</property>
|
||||
<property name="right_margin">6</property>
|
||||
<property name="sensitive">True</property>
|
||||
<property name="wrap_mode">word-char</property>
|
||||
<property name="accepts-tab">False</property>
|
||||
<signal name="state-flags-changed" handler="on_notes_text_state_flags_changed_cb" object="GcalNotesSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,86 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalRemindersSection: Box {
|
||||
orientation: vertical;
|
||||
|
||||
ListBox alarms_listbox {
|
||||
selection-mode: none;
|
||||
row-activated => $on_alarms_listbox_row_activated_cb(template) not-swapped;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
|
||||
Adw.ButtonRow new_alarm_row {
|
||||
title: _("Add Reminder");
|
||||
start-icon-name: "add-reminder-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popover alarms_popover {
|
||||
width-request: 175;
|
||||
|
||||
styles [
|
||||
"menu",
|
||||
]
|
||||
|
||||
Box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
orientation: vertical;
|
||||
|
||||
$GtkModelButton event_start_button {
|
||||
text: _("Event start");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton five_minutes_button {
|
||||
text: _("5 Minutes");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton ten_minutes_button {
|
||||
text: _("10 Minutes");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton fifteen_minutes_button {
|
||||
text: _("15 Minutes");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton thirty_minutes_button {
|
||||
text: _("30 Minutes");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton one_hour_button {
|
||||
text: _("1 Hour");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton one_day_button {
|
||||
text: _("1 Day");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton two_days_button {
|
||||
text: _("2 Days");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton three_days_button {
|
||||
text: _("3 Days");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GtkModelButton one_week_button {
|
||||
text: _("1 Week");
|
||||
clicked => $on_add_alarm_button_clicked_cb(template) not-swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalRemindersSection" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="alarms_listbox">
|
||||
<property name="selection_mode">none</property>
|
||||
<signal name="row-activated" handler="on_alarms_listbox_row_activated_cb" object="GcalRemindersSection" swapped="no" />
|
||||
|
||||
<style>
|
||||
<class name="boxed-list" />
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="AdwButtonRow" id="new_alarm_row">
|
||||
<property name="title" translatable="yes">Add Reminder</property>
|
||||
<property name="start-icon-name">add-reminder-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
|
||||
<object class="GtkPopover" id="alarms_popover">
|
||||
<property name="width_request">175</property>
|
||||
<style>
|
||||
<class name="menu" />
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="event_start_button">
|
||||
<property name="text" translatable="yes">Event start</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="five_minutes_button">
|
||||
<property name="text" translatable="yes">5 Minutes</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="ten_minutes_button">
|
||||
<property name="text" translatable="yes">10 Minutes</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="fifteen_minutes_button">
|
||||
<property name="text" translatable="yes">15 Minutes</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="thirty_minutes_button">
|
||||
<property name="text" translatable="yes">30 Minutes</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="one_hour_button">
|
||||
<property name="text" translatable="yes">1 Hour</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="one_day_button">
|
||||
<property name="text" translatable="yes">1 Day</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="two_days_button">
|
||||
<property name="text" translatable="yes">2 Days</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="three_days_button">
|
||||
<property name="text" translatable="yes">3 Days</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="one_week_button">
|
||||
<property name="text" translatable="yes">1 Week</property>
|
||||
<signal name="clicked" handler="on_add_alarm_button_clicked_cb" object="GcalRemindersSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,120 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalScheduleSection: Box {
|
||||
orientation: vertical;
|
||||
spacing: 12;
|
||||
|
||||
Adw.ToggleGroup schedule_type_toggle_group {
|
||||
active-name: "time-slot";
|
||||
homogeneous: true;
|
||||
|
||||
Adw.Toggle {
|
||||
label: _("_All Day");
|
||||
use-underline: true;
|
||||
name: "all-day";
|
||||
}
|
||||
|
||||
Adw.Toggle {
|
||||
label: _("_Time Slot");
|
||||
use-underline: true;
|
||||
name: "time-slot";
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup start_date_group {
|
||||
$GcalDateChooserRow start_date_row {
|
||||
title: _("Start Date");
|
||||
notify::date => $on_start_date_changed_cb(template) not-swapped;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup end_date_group {
|
||||
$GcalDateChooserRow end_date_row {
|
||||
title: _("End Date");
|
||||
notify::date => $on_end_date_changed_cb(template) not-swapped;
|
||||
}
|
||||
}
|
||||
|
||||
$GcalDateTimeChooser start_date_time_chooser {
|
||||
date-label: _("Start Date");
|
||||
time-label: _("Start Time");
|
||||
notify::date-time => $on_start_date_time_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
$GcalDateTimeChooser end_date_time_chooser {
|
||||
date-label: _("End Date");
|
||||
time-label: _("End Time");
|
||||
notify::date-time => $on_end_date_time_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
Adw.PreferencesGroup {
|
||||
margin-top: 12;
|
||||
|
||||
Adw.ComboRow repeat_combo {
|
||||
title: _("Repeat");
|
||||
valign: center;
|
||||
|
||||
model: StringList {
|
||||
strings [
|
||||
_("No Repeat"),
|
||||
_("Daily"),
|
||||
_("Monday – Friday"),
|
||||
_("Weekly"),
|
||||
_("Monthly"),
|
||||
_("Yearly"),
|
||||
]
|
||||
};
|
||||
|
||||
notify::selected-item => $on_repeat_type_changed_cb();
|
||||
}
|
||||
|
||||
Adw.ComboRow repeat_duration_combo {
|
||||
title: _("End Repeat");
|
||||
valign: center;
|
||||
|
||||
model: StringList {
|
||||
strings [
|
||||
_("Forever"),
|
||||
_("Number of Occurrences"),
|
||||
_("Until Date"),
|
||||
]
|
||||
};
|
||||
|
||||
notify::selected-item => $on_repeat_duration_changed_cb();
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
visible: bind number_of_occurrences_spin.visible;
|
||||
title: _("Number of Occurrences");
|
||||
activatable-widget: number_of_occurrences_spin;
|
||||
|
||||
SpinButton number_of_occurrences_spin {
|
||||
visible: false;
|
||||
numeric: true;
|
||||
adjustment: number_of_occurrences_adjustment;
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
|
||||
Adw.ActionRow {
|
||||
visible: bind until_date_selector.visible;
|
||||
title: _("End Repeat Date");
|
||||
activatable-widget: until_date_selector;
|
||||
|
||||
$GcalDateSelector until_date_selector {
|
||||
visible: false;
|
||||
valign: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adjustment number_of_occurrences_adjustment {
|
||||
lower: 2;
|
||||
upper: 999999999;
|
||||
step-increment: 1;
|
||||
page-increment: 1;
|
||||
page-size: 10;
|
||||
value: 2;
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalScheduleSection" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwToggleGroup" id="schedule_type_toggle_group">
|
||||
<property name="active-name">time-slot</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="AdwToggle">
|
||||
<property name="label" translatable="yes">_All Day</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="name">all-day</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwToggle">
|
||||
<property name="label" translatable="yes">_Time Slot</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="name">time-slot</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Start date -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="start_date_group">
|
||||
<child>
|
||||
<object class="GcalDateChooserRow" id="start_date_row">
|
||||
<property name="title" translatable="yes">Start Date</property>
|
||||
<signal name="notify::date" handler="on_start_date_changed_cb" object="GcalScheduleSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- End date -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="end_date_group">
|
||||
<child>
|
||||
<object class="GcalDateChooserRow" id="end_date_row">
|
||||
<property name="title" translatable="yes">End Date</property>
|
||||
<signal name="notify::date" handler="on_end_date_changed_cb" object="GcalScheduleSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GcalDateTimeChooser" id="start_date_time_chooser">
|
||||
<property name="date-label" translatable="yes">Start Date</property>
|
||||
<property name="time-label" translatable="yes">Start Time</property>
|
||||
<signal name="notify::date-time" handler="on_start_date_time_changed_cb" object="GcalScheduleSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GcalDateTimeChooser" id="end_date_time_chooser">
|
||||
<property name="date-label" translatable="yes">End Date</property>
|
||||
<property name="time-label" translatable="yes">End Time</property>
|
||||
<signal name="notify::date-time" handler="on_end_date_time_changed_cb" object="GcalScheduleSection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="margin-top">12</property>
|
||||
|
||||
<!-- Repeat -->
|
||||
<child>
|
||||
<object class="AdwComboRow" id="repeat_combo">
|
||||
<property name="title" translatable="yes">Repeat</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item translatable="yes">No Repeat</item>
|
||||
<item translatable="yes">Daily</item>
|
||||
<item translatable="yes">Monday – Friday</item>
|
||||
<item translatable="yes">Weekly</item>
|
||||
<item translatable="yes">Monthly</item>
|
||||
<item translatable="yes">Yearly</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
<signal name="notify::selected-item" handler="on_repeat_type_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- End Repeat -->
|
||||
<child>
|
||||
<object class="AdwComboRow" id="repeat_duration_combo">
|
||||
<property name="title" translatable="yes">End Repeat</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item translatable="yes">Forever</item>
|
||||
<item translatable="yes">Number of Occurrences</item>
|
||||
<item translatable="yes">Until Date</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
<signal name="notify::selected-item" handler="on_repeat_duration_changed_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Number of Occurrences -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="visible" bind-source="number_of_occurrences_spin" bind-property="visible" bind-flags="default|sync-create" />
|
||||
<property name="title" translatable="yes">Number of Occurrences</property>
|
||||
<property name="activatable-widget">number_of_occurrences_spin</property>
|
||||
|
||||
<child>
|
||||
<object class = "GtkSpinButton" id="number_of_occurrences_spin">
|
||||
<property name="visible">False</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="adjustment">number_of_occurrences_adjustment</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- End Repeat Date -->
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="visible" bind-source="until_date_selector" bind-property="visible" bind-flags="default|sync-create" />
|
||||
<property name="title" translatable="yes">End Repeat Date</property>
|
||||
<property name="activatable-widget">until_date_selector</property>
|
||||
|
||||
<child>
|
||||
<object class = "GcalDateSelector" id="until_date_selector">
|
||||
<property name="visible">False</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
|
||||
<object class="GtkAdjustment" id="number_of_occurrences_adjustment">
|
||||
<property name="lower">2</property>
|
||||
<property name="upper">999999999</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">1</property>
|
||||
<property name="page-size">10</property>
|
||||
<property name="value">2</property>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalSummarySection: Adw.Bin {
|
||||
ListBox {
|
||||
selection-mode: none;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
|
||||
Adw.EntryRow summary_entry {
|
||||
title: _("Title");
|
||||
changed => $on_summary_entry_text_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
Adw.EntryRow location_entry {
|
||||
title: _("Location");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalSummarySection" parent="AdwBin">
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
|
||||
<style>
|
||||
<class name="boxed-list" />
|
||||
</style>
|
||||
|
||||
<!-- Summary -->
|
||||
<child>
|
||||
<object class="AdwEntryRow" id="summary_entry">
|
||||
<property name="title" translatable="yes">Title</property>
|
||||
<signal name="changed" handler="on_summary_entry_text_changed_cb" object="GcalSummarySection" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Location -->
|
||||
<child>
|
||||
<object class="AdwEntryRow" id="location_entry">
|
||||
<property name="title" translatable="yes">Location</property>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,36 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalTimeChooserRow: Adw.EntryRow {
|
||||
EventControllerFocus {
|
||||
notify::contains-focus => $on_contains_focus_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
MenuButton {
|
||||
icon-name: "clock-alt-symbolic";
|
||||
valign: center;
|
||||
tooltip-text: _("Edit Time");
|
||||
|
||||
popover: Popover {
|
||||
position: bottom;
|
||||
margin-top: 12;
|
||||
margin-bottom: 12;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
|
||||
$GcalTimeSelector time_selector {
|
||||
notify::time => $on_time_selected_changed_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
show => $on_time_popover_shown_cb(template) not-swapped;
|
||||
};
|
||||
|
||||
accessibility {
|
||||
label: _("Edit time");
|
||||
}
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalTimeChooserRow" parent="AdwEntryRow">
|
||||
|
||||
<child>
|
||||
<object class="GtkEventControllerFocus">
|
||||
<signal name="notify::contains-focus" handler="on_contains_focus_changed_cb" object="GcalTimeChooserRow" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">clock-alt-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Edit Time</property>
|
||||
<property name="popover">
|
||||
<object class="GtkPopover">
|
||||
<property name="position">bottom</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
|
||||
<child>
|
||||
<object class="GcalTimeSelector" id="time_selector">
|
||||
<signal name="notify::time" handler="on_time_selected_changed_cb" object="GcalTimeChooserRow" swapped="no" />
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<signal name="show" handler="on_time_popover_shown_cb" object="GcalTimeChooserRow" swapped="no" />
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<accessibility>
|
||||
<property name="label" translatable="yes">Edit time</property>
|
||||
</accessibility>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalTimeZoneDialogRow: Adw.ActionRow {
|
||||
activatable: true;
|
||||
|
||||
styles [
|
||||
"property",
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalTimeZoneDialogRow" parent="AdwActionRow">
|
||||
<property name="activatable">true</property>
|
||||
<style>
|
||||
<class name="property"/>
|
||||
</style>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,48 @@
|
||||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $GcalTimeZoneDialog: Adw.Dialog {
|
||||
title: _("Select Timezone");
|
||||
content-width: 400;
|
||||
content-height: 540;
|
||||
|
||||
child: Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar dialog-header-bar {}
|
||||
|
||||
[top]
|
||||
Adw.Bin {
|
||||
SearchEntry location_entry {
|
||||
placeholder-text: _("Search Locations");
|
||||
search-changed => $on_search_changed(template) not-swapped;
|
||||
stop-search => $on_stop_search_cb(template) not-swapped;
|
||||
}
|
||||
|
||||
styles [
|
||||
"toolbar",
|
||||
]
|
||||
}
|
||||
|
||||
content: Stack stack {
|
||||
Adw.StatusPage empty_search {
|
||||
icon-name: "loupe-large-symbolic";
|
||||
title: _("Search for a Timezone");
|
||||
}
|
||||
|
||||
Adw.PreferencesPage search_results {
|
||||
Adw.PreferencesGroup {
|
||||
ListBox listbox {
|
||||
valign: start;
|
||||
hexpand: true;
|
||||
selection-mode: none;
|
||||
row-activated => $on_row_activated_cb(template) not-swapped;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<interface>
|
||||
<template class="GcalTimeZoneDialog" parent="AdwDialog">
|
||||
<property name="title" translatable="yes">Select Timezone</property>
|
||||
<property name="content_width">400</property>
|
||||
<property name="content_height">540</property>
|
||||
<property name="child">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar" id="dialog-header-bar"/>
|
||||
</child>
|
||||
<child type="top">
|
||||
<object class="AdwBin">
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="location_entry">
|
||||
<property name="placeholder-text" translatable="yes">Search Locations</property>
|
||||
<signal name="search-changed" handler="on_search_changed" object="GcalTimeZoneDialog" swapped="no"/>
|
||||
<signal name="stop-search" handler="on_stop_search_cb" object="GcalTimeZoneDialog" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="toolbar"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
<object class="GtkStack" id="stack">
|
||||
<child>
|
||||
<object class="AdwStatusPage" id="empty_search">
|
||||
<property name="icon_name">loupe-large-symbolic</property>
|
||||
<property name="title" translatable="yes">Search for a Timezone</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwPreferencesPage" id="search_results">
|
||||
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="GtkListBox" id="listbox">
|
||||
<property name="valign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<signal name="row-activated" handler="on_row_activated_cb" object="GcalTimeZoneDialog" swapped="no"/>
|
||||
<style>
|
||||
<class name="boxed-list"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -1,9 +1,37 @@
|
||||
calendar_incs += include_directories('.')
|
||||
|
||||
blueprints = custom_target(
|
||||
'blueprints',
|
||||
input: files(
|
||||
'gcal-alarm-row.blp',
|
||||
'gcal-date-chooser-row.blp',
|
||||
'gcal-date-selector.blp',
|
||||
'gcal-date-time-chooser.blp',
|
||||
'gcal-event-editor-dialog.blp',
|
||||
'gcal-multi-choice.blp',
|
||||
'gcal-notes-section.blp',
|
||||
'gcal-reminders-section.blp',
|
||||
'gcal-schedule-section.blp',
|
||||
'gcal-summary-section.blp',
|
||||
'gcal-time-chooser-row.blp',
|
||||
'gcal-time-zone-dialog-row.blp',
|
||||
'gcal-time-zone-dialog.blp',
|
||||
),
|
||||
output: '.',
|
||||
command: [
|
||||
find_program('blueprint-compiler'),
|
||||
'batch-compile',
|
||||
'@OUTPUT@',
|
||||
'@CURRENT_SOURCE_DIR@',
|
||||
'@INPUT@',
|
||||
],
|
||||
)
|
||||
|
||||
built_sources += gnome.compile_resources(
|
||||
'event-editor-resources',
|
||||
'event-editor.gresource.xml',
|
||||
c_name: 'event_editor',
|
||||
dependencies: blueprints,
|
||||
)
|
||||
|
||||
sources += files(
|
||||
|
||||
Reference in New Issue
Block a user