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,42 @@
using Gtk 4.0;
using Adw 1;
Adw.ActionRow row {
use-markup: false;
activatable: true;
[prefix]
Image icon {
pixel-size: 24;
accessible-role: presentation;
styles [
"calendar-color-image",
]
}
[suffix]
Image read_only_icon {
tooltip-text: _("Read-Only Calendar");
icon-name: "changes-prevent-symbolic";
pixel-size: 20;
valign: center;
}
[suffix]
Switch switch {
valign: center;
tooltip-text: _("Display Calendar");
}
[suffix]
Image {
halign: end;
valign: center;
icon-name: "go-next-symbolic";
accessibility {
label: _("Edit calendar");
}
}
}
@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="AdwActionRow" id="row">
<property name="use-markup">False</property>
<property name="activatable">True</property>
<child type="prefix">
<object class="GtkImage" id="icon">
<property name="pixel-size">24</property>
<property name="accessible-role">presentation</property>
<style>
<class name="calendar-color-image"/>
</style>
</object>
</child>
<!-- Lock icon for read-only calendars -->
<child type="suffix">
<object class="GtkImage" id="read_only_icon">
<property name="tooltip-text" translatable="yes">Read-Only Calendar</property>
<property name="icon-name">changes-prevent-symbolic</property>
<property name="pixel-size">20</property>
<property name="valign">center</property>
</object>
</child>
<child type="suffix">
<object class="GtkSwitch" id="switch">
<property name="valign">center</property>
<property name="tooltip-text" translatable="yes">Display Calendar</property>
</object>
</child>
<child type="suffix">
<object class="GtkImage">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="icon-name">go-next-symbolic</property>
<accessibility>
<property name="label" translatable="yes">Edit calendar</property>
</accessibility>
</object>
</child>
</object>
</interface>
@@ -0,0 +1,13 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarManagementDialog: Adw.Dialog {
title: _("Calendar Settings");
width-request: 360;
height-request: 500;
content-width: 500;
Adw.NavigationView navigation_view {
popped => $on_navigation_view_popped_cb(template) not-swapped;
}
}
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarManagementDialog" parent="AdwDialog">
<property name="title" translatable="yes">Calendar Settings</property>
<property name="width-request">360</property>
<property name="height-request">500</property>
<property name="content-width">500</property>
<child>
<object class="AdwNavigationView" id="navigation_view">
<signal name="popped" handler="on_navigation_view_popped_cb" object="GcalCalendarManagementDialog" swapped="no" />
</object>
</child>
</template>
</interface>
@@ -0,0 +1,74 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarsPage: Adw.NavigationPage {
title: _("Calendars");
tag: "calendars";
child: Adw.ToastOverlay toast_overlay {
Adw.ToolbarView {
[top]
Adw.HeaderBar {}
content: ScrolledWindow {
hexpand: true;
hscrollbar-policy: never;
max-content-height: 900;
propagate-natural-height: true;
child: Adw.Clamp {
child: Box {
orientation: vertical;
spacing: 24;
margin-top: 24;
margin-bottom: 24;
margin-start: 12;
margin-end: 12;
valign: start;
ListBox listbox {
selection-mode: none;
row-activated => $on_listbox_row_activated_cb(template) not-swapped;
styles [
"calendars-list",
"boxed-list",
]
}
};
};
};
[bottom]
Adw.Clamp {
ListBox {
selection-mode: none;
margin-top: 15;
margin-bottom: 15;
margin-start: 12;
margin-end: 12;
Adw.ButtonRow {
title: _("_Add Calendar");
use-underline: true;
end-icon-name: "go-next-symbolic";
activated => $on_new_calendar_row_activated_cb(template) not-swapped;
ShortcutController {
scope: managed;
Shortcut {
trigger: "<Ctrl>n";
action: "activate";
}
}
}
styles [
"boxed-list",
]
}
}
}
};
}
@@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarsPage" parent="AdwNavigationPage">
<property name="title" translatable="yes">Calendars</property>
<property name="tag">calendars</property>
<property name="child">
<object class="AdwToastOverlay" id="toast_overlay">
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar" />
</child>
<property name="content">
<object class="GtkScrolledWindow">
<property name="hexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="max_content_height">900</property>
<property name="propagate_natural_height">True</property>
<property name="child">
<object class="AdwClamp">
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="valign">start</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="selection-mode">none</property>
<signal name="row-activated" handler="on_listbox_row_activated_cb" object="GcalCalendarsPage" swapped="no" />
<style>
<class name="calendars-list"/>
<class name="boxed-list"/>
</style>
</object>
</child>
</object>
</property>
</object>
</property>
</object>
</property>
<child type="bottom">
<object class="AdwClamp">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="margin-top">15</property>
<property name="margin-bottom">15</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<child>
<object class="AdwButtonRow">
<property name="title" translatable="yes">_Add Calendar</property>
<property name="use-underline">true</property>
<property name="end-icon-name">go-next-symbolic</property>
<signal name="activated" handler="on_new_calendar_row_activated_cb" object="GcalCalendarsPage" swapped="no" />
<child>
<object class="GtkShortcutController">
<property name="scope">managed</property>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Ctrl&gt;n</property>
<property name="action">activate</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="boxed-list"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</template>
</interface>
@@ -0,0 +1,93 @@
using Gtk 4.0;
using Adw 1;
template $GcalEditCalendarPage: Adw.NavigationPage {
title: _("Edit Calendar");
tag: "edit-calendar";
child: Adw.ToolbarView {
[top]
Adw.HeaderBar {
title-widget: Adw.WindowTitle {
title: bind name_entry.text;
};
}
content: Adw.PreferencesPage {
Adw.PreferencesGroup {
Adw.ActionRow account_row {
title: _("Account");
subtitle-selectable: true;
styles [
"property",
]
Button settings_button {
tooltip-text: _("Open in Settings");
valign: center;
clicked => $on_settings_button_clicked_cb(template) not-swapped;
styles [
"flat",
]
Image {
icon-name: "external-link-symbolic";
accessible-role: presentation;
}
}
}
Adw.ActionRow calendar_url_row {
title: _("Location");
subtitle-lines: 1;
styles [
"property",
]
}
}
Adw.PreferencesGroup {
Adw.EntryRow name_entry {
title: _("Calendar Name");
}
Adw.ActionRow {
title: _("Color");
activatable-widget: calendar_color_button;
ColorDialogButton calendar_color_button {
valign: center;
dialog: ColorDialog {
modal: true;
with-alpha: false;
};
notify::rgba => $on_calendar_color_changed_cb(template) not-swapped;
}
}
Adw.SwitchRow calendar_visible_row {
title: _("_Display Calendar");
use-underline: true;
notify::active => $on_calendar_visibility_changed_cb(template) not-swapped;
}
}
Adw.PreferencesGroup remove_group {
Adw.ButtonRow remove_button_row {
title: _("_Remove Calendar");
use-underline: true;
activated => $on_remove_button_row_activated_cb(template) not-swapped;
styles [
"destructive-action",
]
}
}
};
};
}
@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalEditCalendarPage" parent="AdwNavigationPage">
<property name="title" translatable="yes">Edit Calendar</property>
<property name="tag">edit-calendar</property>
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="title-widget">
<object class="AdwWindowTitle">
<binding name="title">
<lookup type="GtkEditable" name="text">name_entry</lookup>
</binding>
</object>
</property>
</object>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<!-- Location (URL, file path) -->
<child>
<object class="AdwPreferencesGroup">
<!-- Online Accounts -->
<child>
<object class="AdwActionRow" id="account_row">
<property name="title" translatable="yes">Account</property>
<property name="subtitle-selectable">True</property>
<style>
<class name="property"/>
</style>
<child>
<object class="GtkButton" id="settings_button">
<property name="tooltip-text" translatable="yes">Open in Settings</property>
<property name="valign">center</property>
<signal name="clicked" handler="on_settings_button_clicked_cb" object="GcalEditCalendarPage" swapped="no" />
<style>
<class name="flat"/>
</style>
<child>
<object class="GtkImage">
<property name="icon-name">external-link-symbolic</property>
<property name="accessible-role">presentation</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="calendar_url_row">
<property name="title" translatable="yes">Location</property>
<property name="subtitle-lines">1</property>
<style>
<class name="property"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<!-- Calendar name -->
<child>
<object class="AdwEntryRow" id="name_entry">
<property name="title" translatable="yes">Calendar Name</property>
</object>
</child>
<!-- Color -->
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Color</property>
<property name="activatable-widget">calendar_color_button</property>
<child>
<object class="GtkColorDialogButton" id="calendar_color_button">
<property name="valign">center</property>
<property name="dialog">
<object class="GtkColorDialog">
<property name="modal">True</property>
<property name="with-alpha">False</property>
</object>
</property>
<signal name="notify::rgba" handler="on_calendar_color_changed_cb" object="GcalEditCalendarPage" swapped="no"/>
</object>
</child>
</object>
</child>
<!-- Calendar visibility -->
<child>
<object class="AdwSwitchRow" id="calendar_visible_row">
<property name="title" translatable="yes">_Display Calendar</property>
<property name="use-underline">true</property>
<signal name="notify::active" handler="on_calendar_visibility_changed_cb" object="GcalEditCalendarPage" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="remove_group">
<!-- Remove button -->
<child>
<object class="AdwButtonRow" id="remove_button_row">
<property name="title" translatable="yes">_Remove Calendar</property>
<property name="use-underline">true</property>
<signal name="activated" handler="on_remove_button_row_activated_cb" object="GcalEditCalendarPage" swapped="no" />
<style>
<class name="destructive-action" />
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</template>
</interface>
@@ -0,0 +1,168 @@
using Gtk 4.0;
using Adw 1;
template $GcalNewCalendarPage: Adw.NavigationPage {
title: _("New Calendar");
tag: "new-calendar";
child: Adw.ToolbarView {
[top]
Adw.HeaderBar {
show-end-title-buttons: false;
show-start-title-buttons: false;
}
content: Adw.PreferencesPage {
Adw.PreferencesGroup {
title: _("Create a Local Calendar");
Adw.EntryRow local_calendar_name_row {
title: _("Calendar Name");
notify::text => $on_local_calendar_name_row_text_changed_cb(template) not-swapped;
}
Adw.ActionRow {
title: _("Color");
activatable-widget: local_calendar_color_button;
ColorDialogButton local_calendar_color_button {
valign: center;
dialog: ColorDialog {
modal: true;
with-alpha: false;
};
notify::rgba => $on_local_calendar_color_button_rgba_changed_cb(template) not-swapped;
}
}
}
Adw.PreferencesGroup {
title: _("Connect to an Online Calendar");
Grid {
row-spacing: 12;
column-spacing: 12;
Label {
label: _("HTTPS, CalDAV, or Webcal URLs are supported. Online calendars that can only be updated by the provider will be added as read-only.");
wrap: true;
xalign: 0;
layout {
column: 0;
row: 0;
column-span: 2;
}
}
Entry calendar_address_entry {
hexpand: true;
placeholder-text: "https://example.com/calendar.ics";
input-purpose: url;
notify::text => $on_url_entry_text_changed_cb(template) not-swapped;
activate => $on_calendar_address_activated_cb(template) not-swapped;
layout {
column: 0;
row: 1;
}
}
Revealer web_sources_revealer {
transition-type: slide_down;
transition-duration: 200;
layout {
column: 0;
row: 2;
column-span: 2;
}
Box web_sources_listbox_box {
orientation: vertical;
spacing: 6;
Label web_sources_calendar_label {
label: _("Calendars");
xalign: 0;
styles [
"heading",
]
}
ListBox web_sources_listbox {
activate-on-single-click: false;
selection-mode: none;
styles [
"calendar-list",
]
}
}
}
Label web_description_label {
label: _("If the calendar belongs to one of your online accounts, you can add it through the <a href=\"GOA\">online account settings</a>.");
use-markup: true;
wrap: true;
xalign: 0;
activate-link => $on_web_description_label_link_activated_cb(template) not-swapped;
layout {
column: 0;
row: 3;
column-span: 2;
}
}
}
}
Adw.PreferencesGroup {
Button add_button {
halign: center;
label: C_("button", "Add Calendar");
sensitive: false;
clicked => $on_add_button_clicked_cb(template) not-swapped;
styles [
"pill",
"suggested-action",
]
}
}
};
};
}
Adw.MessageDialog credentials_dialog {
heading: _("Credentials");
hide-on-close: true;
extra-child: Adw.Clamp {
ListBox {
Adw.EntryRow credentials_user_entry {
title: _("User");
}
Adw.PasswordEntryRow credentials_password_entry {
title: _("Password");
}
styles [
"boxed-list",
]
}
};
responses [
cancel: _("_Cancel"),
connect: _("_Connect") suggested,
]
default-response: "connect";
close-response: "cancel";
response => $on_credentials_dialog_response_cb(template) not-swapped;
}
@@ -1,215 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalNewCalendarPage" parent="AdwNavigationPage">
<property name="title" translatable="yes">New Calendar</property>
<property name="tag">new-calendar</property>
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">False</property>
<property name="show-start-title-buttons">False</property>
</object>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<!-- Local calendar -->
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Create a Local Calendar</property>
<!-- Calendar name -->
<child>
<object class="AdwEntryRow" id="local_calendar_name_row">
<property name="title" translatable="yes">Calendar Name</property>
<signal name="notify::text" handler="on_local_calendar_name_row_text_changed_cb" object="GcalNewCalendarPage" swapped="no" />
</object>
</child>
<!-- Color -->
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Color</property>
<property name="activatable-widget">local_calendar_color_button</property>
<child>
<object class="GtkColorDialogButton" id="local_calendar_color_button">
<property name="valign">center</property>
<property name="dialog">
<object class="GtkColorDialog">
<property name="modal">True</property>
<property name="with-alpha">False</property>
</object>
</property>
<signal name="notify::rgba" handler="on_local_calendar_color_button_rgba_changed_cb" object="GcalNewCalendarPage" swapped="no" />
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Connect to an Online Calendar</property>
<child>
<object class="GtkGrid">
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<!-- Online Accounts reference label-->
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">HTTPS, CalDAV, or Webcal URLs are supported. Online calendars that can only be updated by the provider will be added as read-only.</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<layout>
<property name="column">0</property>
<property name="row">0</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<!-- URL entry -->
<child>
<object class="GtkEntry" id="calendar_address_entry">
<property name="hexpand">True</property>
<property name="placeholder-text">https://example.com/calendar.ics</property>
<property name="input-purpose">url</property>
<signal name="notify::text" handler="on_url_entry_text_changed_cb" object="GcalNewCalendarPage" swapped="no" />
<signal name="activate" handler="on_calendar_address_activated_cb" object="GcalNewCalendarPage" swapped="no" />
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkRevealer" id="web_sources_revealer">
<property name="transition_type">slide-down</property>
<property name="transition_duration">200</property>
<layout>
<property name="column">0</property>
<property name="row">2</property>
<property name="column-span">2</property>
</layout>
<child>
<object class="GtkBox" id="web_sources_listbox_box">
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="web_sources_calendar_label">
<property name="label" translatable="yes">Calendars</property>
<property name="xalign">0</property>
<style>
<class name="heading" />
</style>
</object>
</child>
<child>
<object class="GtkListBox" id="web_sources_listbox">
<property name="activate_on_single_click">False</property>
<property name="selection_mode">none</property>
<style>
<class name="calendar-list" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Online Accounts reference label-->
<child>
<object class="GtkLabel" id="web_description_label">
<property name="label" translatable="yes">If the calendar belongs to one of your online accounts, you can add it through the &lt;a href=&quot;GOA&quot;&gt;online account settings&lt;/a&gt;.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<signal name="activate-link" handler="on_web_description_label_link_activated_cb" object="GcalNewCalendarPage" swapped="no" />
<layout>
<property name="column">0</property>
<property name="row">3</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="GtkButton" id="add_button">
<property name="halign">center</property>
<property name="label" translatable="yes" context="button">Add Calendar</property>
<property name="sensitive">False</property>
<signal name="clicked" handler="on_add_button_clicked_cb" object="GcalNewCalendarPage" swapped="no" />
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</template>
<!-- Credentials popover -->
<object class="AdwMessageDialog" id="credentials_dialog">
<property name="heading" translatable="true">Credentials</property>
<property name="hide-on-close">True</property>
<property name="extra-child">
<object class="AdwClamp">
<child>
<object class="GtkListBox">
<child>
<object class="AdwEntryRow" id="credentials_user_entry">
<property name="title" translatable="true">User</property>
</object>
</child>
<child>
<object class="AdwPasswordEntryRow" id="credentials_password_entry">
<property name="title" translatable="true">Password</property>
</object>
</child>
<style>
<class name="boxed-list"/>
</style>
</object>
</child>
</object>
</property>
<responses>
<response id="cancel" translatable="yes">_Cancel</response>
<response id="connect" translatable="yes" appearance="suggested">_Connect</response>
</responses>
<property name="default-response">connect</property>
<property name="close-response">cancel</property>
<signal name="response" handler="on_credentials_dialog_response_cb" object="GcalNewCalendarPage" swapped="no"/>
</object>
</interface>
+20
View File
@@ -1,9 +1,29 @@
calendar_incs += include_directories('.')
blueprints = custom_target(
'blueprints',
input: files(
'calendar-row.blp',
'gcal-calendar-management-dialog.blp',
'gcal-calendars-page.blp',
'gcal-edit-calendar-page.blp',
'gcal-new-calendar-page.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'calendar-management-resources',
'calendar-management.gresource.xml',
c_name: 'calendar_management',
dependencies: blueprints,
)
sources += files(
@@ -0,0 +1,27 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarComboRowItem: Adw.PreferencesRow {
Box {
orientation: horizontal;
spacing: 6;
Image color_image {
styles [
"calendar-color-image",
]
}
Label title_label {
ellipsize: end;
xalign: 0.0;
label: bind template.title;
}
Image visibility_image {
halign: end;
hexpand: true;
icon-name: "eye-not-looking-symbolic";
}
}
}
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarComboRowItem" parent="AdwPreferencesRow">
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="color_image">
<style>
<class name="calendar-color-image"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="title_label">
<property name="ellipsize">end</property>
<property name="xalign">0.0</property>
<property name="label" bind-source="GcalCalendarComboRowItem" bind-property="title" bind-flags="sync-create"/>
</object>
</child>
<child>
<object class="GtkImage" id="visibility_image">
<property name="halign">end</property>
<property name="hexpand">true</property>
<property name="icon-name">eye-not-looking-symbolic</property>
</object>
</child>
</object>
</child>
</template>
</interface>
@@ -0,0 +1,13 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarComboRow: Adw.ComboRow {
title: _("Calendar");
title-lines: 1;
factory: SignalListItemFactory {
setup => $calendar_item_setup_cb();
bind => $calendar_item_bind_cb();
unbind => $calendar_item_unbind_cb();
};
}
-16
View File
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarComboRow" parent="AdwComboRow">
<property name="title" translatable="yes">Calendar</property>
<property name="title-lines">1</property>
<property name="factory">
<object class="GtkSignalListItemFactory">
<signal name="setup" handler="calendar_item_setup_cb"/>
<signal name="bind" handler="calendar_item_bind_cb"/>
<signal name="unbind" handler="calendar_item_unbind_cb"/>
</object>
</property>
</template>
</interface>
+46
View File
@@ -0,0 +1,46 @@
using Gtk 4.0;
using Adw 1;
template $GcalDateChooserDay: Button {
halign: center;
valign: center;
hexpand: true;
vexpand: true;
styles [
"circular",
"day",
"flat",
"text-button",
]
Box {
orientation: vertical;
valign: center;
Label label {
halign: center;
label: "0";
valign: center;
width-chars: 2;
styles [
"day",
"numeric",
]
}
Revealer dot_revealer {
halign: center;
transition-type: crossfade;
valign: end;
visible: false;
child: Adw.Bin dot {
css-name: "dot";
halign: center;
valign: center;
};
}
}
}
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0"?>
<interface>
<template class="GcalDateChooserDay" parent="GtkButton">
<property name="halign">center</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<style>
<class name="circular"/>
<class name="day"/>
<class name="flat"/>
<class name="text-button"/>
</style>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="valign">center</property>
<child>
<object class="GtkLabel" id="label">
<property name="halign">center</property>
<property name="label">0</property>
<property name="valign">center</property>
<property name="width-chars">2</property>
<style>
<class name="day"/>
<class name="numeric"/>
</style>
</object>
</child>
<child>
<object class="GtkRevealer" id="dot_revealer">
<property name="halign">center</property>
<property name="transition-type">crossfade</property>
<property name="valign">end</property>
<property name="visible">False</property>
<property name="child">
<object class="AdwBin" id="dot">
<property name="css-name">dot</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
</property>
</object>
</child>
</object>
</child>
</template>
</interface>
+92
View File
@@ -0,0 +1,92 @@
using Gtk 4.0;
using Adw 1;
template $GcalDateChooser: Adw.Bin {
Grid {
orientation: vertical;
$GcalMultiChoice month_choice {
halign: fill;
min-value: 0;
max-value: 11;
animate: false;
value: 0;
visible: bind $get_split_choice_visible(template.show-heading, template.split-month-year) as <bool>;
notify::value => $split_multi_choice_changed() swapped;
layout {
column: 0;
row: 0;
}
}
$GcalMultiChoice year_choice {
visible: bind $get_split_choice_visible(template.show-heading, template.split-month-year) as <bool>;
halign: fill;
min-value: 1;
max-value: 9999;
animate: false;
value: 0;
notify::value => $split_multi_choice_changed() swapped;
layout {
column: 1;
row: 0;
}
}
$GcalMultiChoice combined_choice {
visible: bind $get_combined_choice_visible(template.show-heading, template.split-month-year) as <bool>;
halign: fill;
min-value: 12;
max-value: 119999;
popover: popover;
animate: false;
value: 0;
notify::value => $combined_multi_choice_changed() swapped;
layout {
column: 0;
column-span: 2;
row: 0;
}
}
Grid grid {
row-homogeneous: true;
column-homogeneous: true;
layout {
column: 0;
column-span: 2;
row: 1;
}
}
}
}
Popover popover {
Box {
orientation: vertical;
spacing: 12;
$GcalMultiChoice popover_month_choice {
min-value: bind month_choice.min-value bidirectional;
max-value: bind month_choice.max-value bidirectional;
animate: bind month_choice.animate bidirectional;
value: bind month_choice.value bidirectional;
}
$GcalMultiChoice {
min-value: bind year_choice.min-value bidirectional;
max-value: bind year_choice.max-value bidirectional;
animate: bind year_choice.animate bidirectional;
value: bind year_choice.value bidirectional;
}
styles [
"activatable",
"month",
]
}
}
-113
View File
@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalDateChooser" parent="AdwBin">
<child>
<object class="GtkGrid">
<property name="orientation">vertical</property>
<child>
<object class="GcalMultiChoice" id="month_choice">
<property name="halign">fill</property>
<property name="min-value">0</property>
<property name="max-value">11</property>
<property name="animate">False</property>
<property name="value">0</property>
<binding name="visible">
<closure type="gboolean" function="get_split_choice_visible">
<lookup name="show-heading">GcalDateChooser</lookup>
<lookup name="split-month-year">GcalDateChooser</lookup>
</closure>
</binding>
<signal name="notify::value" handler="split_multi_choice_changed" swapped="yes"/>
<layout>
<property name="column">0</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GcalMultiChoice" id="year_choice">
<binding name="visible">
<closure type="gboolean" function="get_split_choice_visible">
<lookup name="show-heading">GcalDateChooser</lookup>
<lookup name="split-month-year">GcalDateChooser</lookup>
</closure>
</binding>
<property name="halign">fill</property>
<property name="min-value">1</property>
<property name="max-value">9999</property>
<property name="animate">False</property>
<property name="value">0</property>
<signal name="notify::value" handler="split_multi_choice_changed" swapped="yes"/>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GcalMultiChoice" id="combined_choice">
<binding name="visible">
<closure type="gboolean" function="get_combined_choice_visible">
<lookup name="show-heading">GcalDateChooser</lookup>
<lookup name="split-month-year">GcalDateChooser</lookup>
</closure>
</binding>
<property name="halign">fill</property>
<!-- From January 1 (month 12) to December 9999 (month 119999) -->
<property name="min-value">12</property>
<property name="max-value">119999</property>
<property name="popover">popover</property>
<property name="animate">False</property>
<property name="value">0</property>
<signal name="notify::value" handler="combined_multi_choice_changed" swapped="yes"/>
<layout>
<property name="column">0</property>
<property name="column-span">2</property>
<property name="row">0</property>
</layout>
</object>
</child>
<child>
<object class="GtkGrid" id="grid">
<property name="row-homogeneous">True</property>
<property name="column-homogeneous">True</property>
<layout>
<property name="column">0</property>
<property name="column-span">2</property>
<property name="row">1</property>
</layout>
</object>
</child>
</object>
</child>
</template>
<object class="GtkPopover" id="popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GcalMultiChoice" id="popover_month_choice">
<property name="min-value" bind-source="month_choice" bind-property="min-value" bind-flags="sync-create|bidirectional" />
<property name="max-value" bind-source="month_choice" bind-property="max-value" bind-flags="sync-create|bidirectional" />
<property name="animate" bind-source="month_choice" bind-property="animate" bind-flags="sync-create|bidirectional" />
<property name="value" bind-source="month_choice" bind-property="value" bind-flags="sync-create|bidirectional" />
</object>
</child>
<child>
<object class="GcalMultiChoice">
<property name="min-value" bind-source="year_choice" bind-property="min-value" bind-flags="sync-create|bidirectional" />
<property name="max-value" bind-source="year_choice" bind-property="max-value" bind-flags="sync-create|bidirectional" />
<property name="animate" bind-source="year_choice" bind-property="animate" bind-flags="sync-create|bidirectional" />
<property name="value" bind-source="year_choice" bind-property="value" bind-flags="sync-create|bidirectional" />
</object>
</child>
<style>
<class name="activatable"/>
<class name="month"/>
</style>
</object>
</child>
</object>
</interface>
+19
View File
@@ -1,9 +1,28 @@
calendar_incs += include_directories('.')
blueprints = custom_target(
'blueprints',
input: files(
'gcal-calendar-combo-row-item.blp',
'gcal-calendar-combo-row.blp',
'gcal-date-chooser-day.blp',
'gcal-date-chooser.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'common-resources',
'common.gresource.xml',
c_name: 'common',
dependencies: blueprints,
)
sources += files(
+27
View File
@@ -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",
]
}
}
-28
View File
@@ -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">&lt;Control&gt;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",
]
}
}
-67
View File
@@ -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>
+28
View File
@@ -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(
+26
View File
@@ -0,0 +1,26 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarList: Adw.Bin {
child: ScrolledWindow {
hscrollbar-policy: never;
propagate-natural-height: true;
propagate-natural-width: true;
child: Adw.Clamp {
maximum-size: 800;
tightening-threshold: 800;
child: ListBox calendar_listbox {
hexpand: true;
selection-mode: none;
row-activated => $on_listbox_row_activated_cb(template) not-swapped;
styles [
"navigation-sidebar",
"calendar-list",
]
};
};
};
}
-31
View File
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarList" parent="AdwBin">
<property name="child">
<object class="GtkScrolledWindow">
<property name="hscrollbar_policy">never</property>
<property name="propagate-natural-height">True</property>
<property name="propagate-natural-width">True</property>
<property name="child">
<object class="AdwClamp">
<property name="maximum-size">800</property>
<property name="tightening-threshold">800</property>
<property name="child">
<object class="GtkListBox" id="calendar_listbox">
<style>
<class name="navigation-sidebar" />
</style>
<property name="hexpand">True</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="on_listbox_row_activated_cb" object="GcalCalendarList" swapped="no" />
<style>
<class name="calendar-list" />
</style>
</object>
</property>
</object>
</property>
</object>
</property>
</template>
</interface>
@@ -0,0 +1,48 @@
using Gtk 4.0;
using Adw 1;
template $GcalCalendarNavigationButton: Adw.Bin {
child: Stack stack {
hhomogeneous: false;
StackPage {
name: "active";
child: MenuButton button {
popover: popover_date_chooser;
label: _("_Choose Date");
use-underline: true;
can-shrink: true;
tooltip-text: _("Choose a Date");
always-show-arrow: true;
};
}
StackPage {
name: "inactive";
child: Label static_label {
styles [
"heading",
]
label: bind button.label no-sync-create;
margin-start: 9;
margin-end: 9;
};
}
visible-child-name: "active";
};
}
Popover popover_date_chooser {
position: bottom;
child: $GcalDateChooser {
split-month-year: true;
vexpand: false;
valign: end;
active-date: bind template.active-date no-sync-create bidirectional;
};
}
@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalCalendarNavigationButton" parent="AdwBin">
<property name="child">
<object class="GtkStack" id="stack">
<property name="hhomogeneous">False</property>
<child>
<object class="GtkStackPage">
<property name="name">active</property>
<property name="child">
<object class="GtkMenuButton" id="button">
<property name="popover">popover_date_chooser</property>
<property name="label" translatable="yes">_Choose Date</property>
<property name="use-underline">True</property>
<property name="can-shrink">True</property>
<property name="tooltip-text" translatable="yes">Choose a Date</property>
<property name="always-show-arrow">True</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">inactive</property>
<property name="child">
<object class="GtkLabel" id="static_label">
<style>
<class name="heading" />
</style>
<property name="label" bind-source="button" bind-property="label" />
<property name="margin-start">9</property>
<property name="margin-end">9</property>
</object>
</property>
</object>
</child>
<property name="visible-child-name">active</property>
</object>
</property>
</template>
<object class="GtkPopover" id="popover_date_chooser">
<property name="position">bottom</property>
<property name="child">
<object class="GcalDateChooser">
<property name="split-month-year">True</property>
<property name="vexpand">False</property>
<property name="valign">end</property>
<property name="active-date" bind-source="GcalCalendarNavigationButton" bind-property="active-date" bind-flags="bidirectional" />
</object>
</property>
</object>
</interface>
+165
View File
@@ -0,0 +1,165 @@
using Gtk 4.0;
template $GcalEventPopover: Popover {
default-widget: action_button;
position: top;
width-request: 250;
styles [
"event-popover",
]
child: Box {
orientation: vertical;
Box {
spacing: 18;
margin-top: 18;
margin-bottom: 12;
margin-start: 18;
margin-end: 18;
Box {
hexpand: true;
orientation: vertical;
spacing: 6;
Label summary_label {
selectable: true;
wrap: true;
wrap-mode: word_char;
xalign: 0.0;
max-width-chars: 23;
lines: 6;
ellipsize: end;
styles [
"title-4",
]
}
Label date_time_label {
xalign: 0.0;
styles [
"dim-label",
]
}
}
Box {
spacing: 6;
Image read_only_icon {
tooltip-markup: _("<b>This event is part of a read-only calendar</b>\n You cannot delete or change this event.");
icon-name: "changes-prevent-symbolic";
pixel-size: 18;
valign: start;
halign: end;
margin-top: 8;
margin-bottom: 8;
styles [
"dim-label",
]
}
Button action_button {
can-focus: true;
valign: start;
halign: end;
styles [
"circular",
]
clicked => $on_action_button_clicked_cb(template) not-swapped;
}
}
}
Separator {}
Label placeholder_label {
vexpand: true;
label: _("<i>No event notes</i>");
margin-top: 12;
margin-bottom: 12;
use-markup: true;
styles [
"dim-label",
]
}
ScrolledWindow description_scrolled_window {
hscrollbar-policy: never;
propagate-natural-height: true;
propagate-natural-width: true;
max-content-height: 350;
child: Label description_label {
use-markup: true;
selectable: true;
halign: fill;
xalign: 0.0;
wrap: true;
max-width-chars: 35;
wrap-mode: word_char;
margin-top: 12;
margin-bottom: 18;
margin-start: 18;
margin-end: 18;
};
}
Box location_box {
orientation: vertical;
Separator {}
Box {
orientation: vertical;
margin-top: 12;
margin-bottom: 12;
margin-start: 18;
margin-end: 18;
Label {
halign: start;
label: _("Location");
styles [
"heading",
]
}
Label location_label {
halign: start;
selectable: true;
ellipsize: end;
max-width-chars: 35;
}
}
}
Box meetings_box {
orientation: vertical;
visible: false;
Separator {}
ListBox meetings_listbox {
selection-mode: none;
margin-top: 12;
margin-bottom: 12;
margin-start: 18;
margin-end: 18;
styles [
"calendar-list",
]
}
}
};
}
-214
View File
@@ -1,214 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalEventPopover" parent="GtkPopover">
<property name="default-widget">action_button</property>
<property name="position">top</property>
<property name="width-request">250</property>
<style>
<class name="event-popover" />
</style>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="spacing">18</property>
<property name="margin-top">18</property>
<property name="margin-bottom">12</property>
<property name="margin-start">18</property>
<property name="margin-end">18</property>
<child>
<object class="GtkBox">
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<!-- Title -->
<child>
<object class="GtkLabel" id="summary_label">
<property name="selectable">True</property>
<property name="wrap">True</property>
<property name="wrap-mode">word-char</property>
<property name="xalign">0.0</property>
<property name="max-width-chars">22.5</property>
<property name="lines">6</property>
<property name="ellipsize">end</property>
<style>
<class name="title-4" />
</style>
</object>
</child>
<!-- Date & Time -->
<child>
<object class="GtkLabel" id="date_time_label">
<property name="xalign">0.0</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="spacing">6</property>
<!-- Lock icon for read-only events -->
<child>
<object class="GtkImage" id="read_only_icon">
<property name="tooltip-markup" translatable="yes">&lt;b&gt;This event is part of a read-only calendar&lt;/b&gt;
You cannot delete or change this event.</property>
<property name="icon-name">changes-prevent-symbolic</property>
<property name="pixel-size">18</property>
<property name="valign">start</property>
<property name="halign">end</property>
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
<!-- Edit/View button -->
<child>
<object class="GtkButton" id="action_button">
<property name="can-focus">True</property>
<property name="valign">start</property>
<property name="halign">end</property>
<style>
<class name="circular" />
</style>
<signal name="clicked" handler="on_action_button_clicked_cb" object="GcalEventPopover" swapped="no" />
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator" />
</child>
<!-- Placeholder -->
<child>
<object class="GtkLabel" id="placeholder_label">
<property name="vexpand">True</property>
<property name="label" translatable="yes">&lt;i&gt;No event notes&lt;/i&gt;</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="use-markup">True</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
<!-- Description -->
<child>
<object class="GtkScrolledWindow" id="description_scrolled_window">
<property name="hscrollbar-policy">never</property>
<property name="propagate-natural-height">True</property>
<property name="propagate-natural-width">True</property>
<property name="max-content-height">350</property>
<property name="child">
<object class="GtkLabel" id="description_label">
<property name="use-markup">True</property>
<property name="selectable">True</property>
<property name="halign">fill</property>
<property name="xalign">0.0</property>
<property name="wrap">True</property>
<property name="max-width-chars">35</property>
<property name="wrap-mode">word-char</property>
<property name="margin-top">12</property>
<property name="margin-bottom">18</property>
<property name="margin-start">18</property>
<property name="margin-end">18</property>
</object>
</property>
</object>
</child>
<!-- Location -->
<child>
<object class="GtkBox" id="location_box">
<property name="orientation">vertical</property>
<child>
<object class="GtkSeparator" />
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="margin-start">18</property>
<property name="margin-end">18</property>
<child>
<object class="GtkLabel">
<property name="halign">start</property>
<property name="label" translatable="yes">Location</property>
<style>
<class name="heading" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="location_label">
<property name="halign">start</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">35</property>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Meetings -->
<child>
<object class="GtkBox" id="meetings_box">
<property name="orientation">vertical</property>
<property name="visible">False</property>
<child>
<object class="GtkSeparator" />
</child>
<child>
<object class="GtkListBox" id="meetings_listbox">
<property name="selection-mode">none</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="margin-start">18</property>
<property name="margin-end">18</property>
<style>
<class name="calendar-list" />
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</template>
</interface>
+89
View File
@@ -0,0 +1,89 @@
using Gtk 4.0;
using Adw 1;
template $GcalEventWidget: Widget {
focusable: true;
overflow: hidden;
receives-default: true;
DragSource drag_source {
prepare => $on_drag_source_prepare_cb(template) not-swapped;
begin => $on_drag_source_begin_cb(template) not-swapped;
}
GestureClick {
button: 1;
pressed => $on_click_gesture_pressed_cb(template) not-swapped;
released => $on_click_gesture_release_cb(template) not-swapped;
}
Box main_widget {
hexpand: false;
Adw.Bin edge {
styles [
"edge",
]
}
$GcalOverflowBin {
hexpand: true;
request-mode: width-for-height;
styles [
"content",
]
Adw.Squeezer squeezer {
hexpand: false;
homogeneous: false;
orientation: vertical;
Box vertical_box {
visible: bind $get_vertical_enabled(template.event, template.orientation) as <bool>;
orientation: vertical;
$GcalOverflowBin {
request-mode: width-for-height;
Label {
label: bind timestamp_label.label no-sync-create;
xalign: 0.0;
styles [
"dim-label",
]
}
}
Inscription {
text: bind summary_inscription.text no-sync-create;
hexpand: true;
vexpand: true;
xalign: 0.0;
yalign: 0.0;
min-lines: 1;
text-overflow: ellipsize_end;
}
}
Box horizontal_box {
spacing: 4;
Inscription summary_inscription {
hexpand: true;
xalign: 0.0;
min-lines: 1;
text-overflow: ellipsize_end;
}
Label timestamp_label {
styles [
"dim-label",
]
}
}
}
}
}
}
-119
View File
@@ -1,119 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalEventWidget" parent="GtkWidget">
<property name="focusable">True</property>
<property name="overflow">hidden</property>
<property name="receives-default">True</property>
<!-- Drag Source -->
<child>
<object class="GtkDragSource" id="drag_source">
<signal name="prepare" handler="on_drag_source_prepare_cb" object="GcalEventWidget" swapped="no" />
<signal name="begin" handler="on_drag_source_begin_cb" object="GcalEventWidget" swapped="no" />
</object>
</child>
<!-- Click Gesture -->
<child>
<object class="GtkGestureClick">
<property name="button">1</property>
<signal name="pressed" handler="on_click_gesture_pressed_cb" object="GcalEventWidget" swapped="no" />
<signal name="released" handler="on_click_gesture_release_cb" object="GcalEventWidget" swapped="no" />
</object>
</child>
<child>
<object class="GtkBox" id="main_widget">
<property name="hexpand">False</property>
<child>
<object class="AdwBin" id="edge">
<style>
<class name="edge" />
</style>
</object>
</child>
<!-- Overflow Bin -->
<child>
<object class="GcalOverflowBin">
<property name="hexpand">True</property>
<property name="request-mode">width-for-height</property>
<style>
<class name="content" />
</style>
<!-- Main Stack -->
<child>
<object class="AdwSqueezer" id="squeezer">
<property name="hexpand">False</property>
<property name="homogeneous">False</property>
<property name="orientation">vertical</property>
<!-- Vertical page -->
<child>
<object class="GtkBox" id="vertical_box">
<binding name="visible">
<closure type="gboolean" function="get_vertical_enabled">
<lookup name="event">GcalEventWidget</lookup>
<lookup name="orientation">GcalEventWidget</lookup>
</closure>
</binding>
<property name="orientation">vertical</property>
<child>
<object class="GcalOverflowBin">
<property name="request-mode">width-for-height</property>
<child>
<object class="GtkLabel">
<property name="label" bind-source="timestamp_label" bind-property="label" bind-flags="default" />
<property name="xalign">0.0</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkInscription">
<property name="text" bind-source="summary_inscription" bind-property="text" bind-flags="default" />
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="xalign">0.0</property>
<property name="yalign">0.0</property>
<property name="min-lines">1</property>
<property name="text-overflow">ellipsize-end</property>
</object>
</child>
</object>
</child>
<!-- Horizontal page -->
<child>
<object class="GtkBox" id="horizontal_box">
<property name="spacing">4</property>
<child>
<object class="GtkInscription" id="summary_inscription">
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
<property name="min-lines">1</property>
<property name="text-overflow">ellipsize-end</property>
</object>
</child>
<child>
<object class="GtkLabel" id="timestamp_label">
<style>
<class name="dim-label" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+44
View File
@@ -0,0 +1,44 @@
using Gtk 4.0;
template $GcalMeetingRow: ListBoxRow {
activatable: false;
selectable: false;
child: Box {
spacing: 6;
Box {
orientation: vertical;
hexpand: true;
Label title {
halign: start;
styles [
"heading",
]
}
Label subtitle {
halign: start;
single-line-mode: true;
ellipsize: end;
max-width-chars: 25;
}
}
Button join_button {
halign: end;
valign: center;
margin-start: 12;
use-underline: true;
label: _("_Join");
styles [
"suggested-action",
]
clicked => $on_join_button_clicked_cb(template) not-swapped;
}
};
}
-53
View File
@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMeetingRow" parent="GtkListBoxRow">
<property name="activatable">False</property>
<property name="selectable">False</property>
<property name="child">
<object class="GtkBox">
<property name="spacing">6</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<child>
<object class="GtkLabel" id="title">
<property name="halign">start</property>
<style>
<class name="heading" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="subtitle">
<property name="halign">start</property>
<property name="single-line-mode">True</property>
<property name="ellipsize">end</property>
<property name="max-width-chars">25</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="join_button">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="margin-start">12</property>
<property name="use-underline">True</property>
<!-- Translators: "Join" as in "Join meeting" -->
<property name="label" translatable="yes">_Join</property>
<style>
<class name="suggested-action" />
</style>
<signal name="clicked" handler="on_join_button_clicked_cb" object="GcalMeetingRow" swapped="no" />
</object>
</child>
</object>
</property>
</template>
</interface>
+166
View File
@@ -0,0 +1,166 @@
using Gtk 4.0;
template $GcalQuickAddPopover: Popover {
width-request: 350;
show => $gtk_widget_grab_focus(summary_entry);
Stack stack {
hexpand: true;
vexpand: true;
margin-top: 12;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
hhomogeneous: false;
vhomogeneous: true;
transition-type: slide_left_right;
interpolate-size: true;
StackPage {
name: "events";
child: Grid {
row-spacing: 12;
column-spacing: 12;
Label title_label {
hexpand: true;
styles [
"heading",
]
layout {
column: 0;
row: 0;
column-span: 3;
}
}
Entry summary_entry {
hexpand: true;
notify::text => $summary_entry_text_changed(template) not-swapped;
activate => $summary_entry_activated(template) not-swapped;
layout {
column: 0;
row: 1;
column-span: 3;
}
}
Button select_calendar_button {
hexpand: true;
clicked => $select_calendar_button_clicked(template);
layout {
column: 0;
row: 2;
column-span: 3;
}
Box {
spacing: 12;
Image color_image {
styles [
"calendar-color-image",
]
}
Label calendar_name_label {
hexpand: true;
xalign: 0;
}
Image {
icon-name: "go-next-symbolic";
}
}
}
Button edit_button {
label: _("Edit Details…");
margin-top: 6;
clicked => $edit_or_create_event(template);
layout {
column: 0;
row: 3;
}
}
Button add_button {
label: _("Add");
sensitive: false;
margin-top: 6;
clicked => $edit_or_create_event(template);
layout {
column: 2;
row: 3;
}
styles [
"suggested-action",
]
}
};
}
StackPage {
name: "calendars";
child: Box {
orientation: vertical;
spacing: 6;
CenterBox {
[start]
Button back_button {
icon-name: "go-previous-symbolic";
clicked => $back_button_clicked(template);
styles [
"flat",
]
}
[center]
Label {
label: _("Calendar");
styles [
"heading",
]
}
}
ScrolledWindow {
hexpand: true;
vexpand: true;
Viewport {
scroll-to-focus: true;
ListBox calendars_listbox {
selection-mode: none;
row-activated => $select_row(template);
styles [
"calendars-list",
]
}
}
}
};
}
}
}
SizeGroup {
widgets [
edit_button,
add_button,
]
}
-176
View File
@@ -1,176 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.16"/>
<template class="GcalQuickAddPopover" parent="GtkPopover">
<property name="width_request">350</property>
<signal name="show" handler="gtk_widget_grab_focus" object="summary_entry" swapped="yes" />
<child>
<object class="GtkStack" id="stack">
<property name="hexpand">True</property>
<property name="vexpand">True</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>
<property name="hhomogeneous">False</property>
<property name="vhomogeneous">True</property>
<property name="transition_type">slide-left-right</property>
<property name="interpolate_size">True</property>
<child>
<object class="GtkStackPage">
<property name="name">events</property>
<property name="child">
<object class="GtkGrid">
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="title_label">
<property name="hexpand">True</property>
<style>
<class name="heading" />
</style>
<layout>
<property name="column">0</property>
<property name="row">0</property>
<property name="column-span">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkEntry" id="summary_entry">
<property name="hexpand">True</property>
<signal name="notify::text" handler="summary_entry_text_changed" object="GcalQuickAddPopover" swapped="no" />
<signal name="activate" handler="summary_entry_activated" object="GcalQuickAddPopover" swapped="no" />
<layout>
<property name="column">0</property>
<property name="row">1</property>
<property name="column-span">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="select_calendar_button">
<property name="hexpand">True</property>
<signal name="clicked" handler="select_calendar_button_clicked" object="GcalQuickAddPopover" swapped="yes" />
<layout>
<property name="column">0</property>
<property name="row">2</property>
<property name="column-span">3</property>
</layout>
<child>
<object class="GtkBox">
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="color_image">
<style>
<class name="calendar-color-image"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="calendar_name_label">
<property name="hexpand">True</property>
<property name="xalign">0</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon_name">go-next-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="edit_button">
<property name="label" translatable="yes">Edit Details…</property>
<property name="margin_top">6</property>
<signal name="clicked" handler="edit_or_create_event" object="GcalQuickAddPopover" swapped="yes" />
<layout>
<property name="column">0</property>
<property name="row">3</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="add_button">
<property name="label" translatable="yes">Add</property>
<property name="sensitive">False</property>
<property name="margin_top">6</property>
<signal name="clicked" handler="edit_or_create_event" object="GcalQuickAddPopover" swapped="yes" />
<layout>
<property name="column">2</property>
<property name="row">3</property>
</layout>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">calendars</property>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCenterBox">
<child type="start">
<object class="GtkButton" id="back_button">
<property name="icon_name">go-previous-symbolic</property>
<signal name="clicked" handler="back_button_clicked" object="GcalQuickAddPopover" swapped="yes" />
<style>
<class name="flat"/>
</style>
</object>
</child>
<child type="center">
<object class="GtkLabel">
<property name="label" translatable="yes">Calendar</property>
<style>
<class name="heading" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkViewport">
<property name="scroll-to-focus">True</property>
<child>
<object class="GtkListBox" id="calendars_listbox">
<property name="selection_mode">none</property>
<signal name="row-activated" handler="select_row" object="GcalQuickAddPopover" swapped="yes" />
<style>
<class name="calendars-list"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup">
<widgets>
<widget name="edit_button"/>
<widget name="add_button"/>
</widgets>
</object>
</interface>
+166
View File
@@ -0,0 +1,166 @@
using Gtk 4.0;
using Adw 1;
template $GcalSearchButton: Adw.Bin {
EventControllerFocus {
leave => $on_focus_controller_leave_cb(template) not-swapped;
}
Stack stack {
hhomogeneous: false;
vhomogeneous: true;
interpolate-size: true;
transition-type: crossfade;
transition-duration: 200;
styles [
"suggestionbutton",
]
StackPage {
name: "button";
child: Button button {
halign: start;
icon-name: "edit-find-symbolic";
tooltip-text: _("Search Events");
clicked => $on_button_clicked_cb(template) not-swapped;
ShortcutController {
scope: global;
Shortcut {
trigger: "<Control>f";
action: "activate";
}
}
};
}
StackPage {
name: "entry";
child: SearchEntry entry {
placeholder-text: _("Search events");
max-width-chars: 0;
width-chars: 0;
search-delay: 500;
activate => $on_entry_activate_cb(template) not-swapped;
next-match => $on_entry_next_match_cb(template) not-swapped;
previous-match => $on_entry_previous_match_cb(template) not-swapped;
search-changed => $on_entry_search_changed_cb(template) not-swapped;
stop-search => $on_entry_stop_search_cb(template) not-swapped;
accessibility {
labelled-by: [
entry,
];
}
ShortcutController {
Shortcut {
trigger: "Up";
action: "signal(previous-match)";
}
Shortcut {
trigger: "Down";
action: "signal(next-match)";
}
}
};
}
}
}
Popover popover {
position: bottom;
autohide: false;
default-widget: results_listview;
styles [
"menu",
]
Revealer results_revealer {
transition-type: slide_down;
notify::reveal-child => $on_results_revealer_child_reveal_state_changed_cb(template) not-swapped;
notify::child-revealed => $on_results_revealer_child_reveal_state_changed_cb(template) not-swapped;
ScrolledWindow {
max-content-width: 450;
max-content-height: 400;
propagate-natural-width: true;
propagate-natural-height: true;
hscrollbar-policy: never;
ListView results_listview {
hscroll-policy: natural;
vscroll-policy: natural;
single-click-activate: true;
model: SingleSelection results_selection_model {
autoselect: true;
can-unselect: false;
};
factory: BuilderListItemFactory {
template ListItem {
activatable: true;
selectable: true;
child: Box {
Image image {
valign: center;
hexpand: false;
icon-size: normal;
paintable: bind template.item as <$GcalSearchHit>.primary-icon;
accessibility {
labelled-by: [
title,
];
}
styles [
"title",
]
}
Label title {
use-markup: true;
ellipsize: end;
xalign: 0.0;
max-width-chars: 40;
label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.title) as <string>;
}
Label separator {
label: "—";
visible: bind $string_is_not_empty_cb(template.item as <$GcalSearchHit>.subtitle) as <bool>;
styles [
"dim-label",
]
}
Label subtitle {
hexpand: true;
use-markup: true;
ellipsize: end;
xalign: 0.0;
label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.subtitle) as <string>;
styles [
"subtitle",
]
}
};
}
};
activate => $on_results_listview_activated_cb(template) not-swapped;
}
}
}
}
-223
View File
@@ -1,223 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalSearchButton" parent="AdwBin">
<child>
<object class="GtkEventControllerFocus">
<signal name="leave" handler="on_focus_controller_leave_cb" object="GcalSearchButton" swapped="no" />
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="hhomogeneous">False</property>
<property name="vhomogeneous">True</property>
<property name="interpolate-size">True</property>
<property name="transition-type">crossfade</property>
<property name="transition-duration">200</property>
<style>
<class name="suggestionbutton" />
</style>
<child>
<object class="GtkStackPage">
<property name="name">button</property>
<property name="child">
<object class="GtkButton" id="button">
<property name="halign">start</property>
<property name="icon-name">edit-find-symbolic</property>
<property name="tooltip-text" translatable="yes">Search Events</property>
<signal name="clicked" handler="on_button_clicked_cb" object="GcalSearchButton" swapped="no" />
<child>
<object class='GtkShortcutController'>
<property name='scope'>global</property>
<child>
<object class='GtkShortcut'>
<property name='trigger'>&lt;Control&gt;f</property>
<property name='action'>activate</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkSearchEntry" id="entry">
<property name="placeholder-text" translatable="yes">Search events</property>
<property name="max-width-chars">0</property>
<property name="width-chars">0</property>
<property name="search-delay">500</property>
<signal name="activate" handler="on_entry_activate_cb" object="GcalSearchButton" swapped="no" />
<signal name="next-match" handler="on_entry_next_match_cb" object="GcalSearchButton" swapped="no" />
<signal name="previous-match" handler="on_entry_previous_match_cb" object="GcalSearchButton" swapped="no" />
<signal name="search-changed" handler="on_entry_search_changed_cb" object="GcalSearchButton" swapped="no" />
<signal name="stop-search" handler="on_entry_stop_search_cb" object="GcalSearchButton" swapped="no" />
<accessibility>
<relation name="labelled-by">entry</relation>
</accessibility>
<child>
<object class="GtkShortcutController">
<child>
<object class="GtkShortcut">
<property name='trigger'>Up</property>
<property name='action'>signal(previous-match)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name='trigger'>Down</property>
<property name='action'>signal(next-match)</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</child>
</template>
<object class="GtkPopover" id="popover">
<property name="position">bottom</property>
<property name="autohide">False</property>
<property name="default-widget">results_listview</property>
<style>
<class name="menu" />
</style>
<child>
<object class="GtkRevealer" id="results_revealer">
<property name="transition-type">slide-down</property>
<signal name="notify::reveal-child" handler="on_results_revealer_child_reveal_state_changed_cb" object="GcalSearchButton" swapped="no" />
<signal name="notify::child-revealed" handler="on_results_revealer_child_reveal_state_changed_cb" object="GcalSearchButton" swapped="no" />
<child>
<object class="GtkScrolledWindow">
<property name="max-content-width">450</property>
<property name="max-content-height">400</property>
<property name="propagate-natural-width">True</property>
<property name="propagate-natural-height">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkListView" id="results_listview">
<property name="hscroll-policy">natural</property>
<property name="vscroll-policy">natural</property>
<property name="single-click-activate">True</property>
<property name="model">
<object class="GtkSingleSelection" id="results_selection_model">
<property name="autoselect">True</property>
<property name="can-unselect">False</property>
</object>
</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GtkListItem">
<property name="activatable">True</property>
<property name="selectable">True</property>
<property name="child">
<object class="GtkBox">
<child>
<object class="GtkImage" id="image">
<property name="valign">center</property>
<property name="hexpand">False</property>
<property name="icon-size">normal</property>
<binding name="paintable">
<lookup name="primary-icon" type="GcalSearchHit">
<lookup name="item">GtkListItem</lookup>
</lookup>
</binding>
<accessibility>
<relation name="labelled-by">title</relation>
</accessibility>
<style>
<class name="title"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="title">
<property name="use-markup">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0.0</property>
<property name="max-width-chars">40</property>
<binding name="label">
<closure type="gchararray" function="escape_markup_cb">
<lookup name="title" type="GcalSearchHit">
<lookup name="item">GtkListItem</lookup>
</lookup>
</closure>
</binding>
</object>
</child>
<child>
<object class="GtkLabel" id="separator">
<property name="label">—</property>
<binding name="visible">
<closure type="gboolean" function="string_is_not_empty_cb">
<lookup name="subtitle" type="GcalSearchHit">
<lookup name="item">GtkListItem</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="subtitle">
<property name="hexpand">True</property>
<property name="use-markup">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0.0</property>
<binding name="label">
<closure type="gchararray" function="escape_markup_cb">
<lookup name="subtitle" type="GcalSearchHit">
<lookup name="item">GtkListItem</lookup>
</lookup>
</closure>
</binding>
<style>
<class name="subtitle"/>
</style>
</object>
</child>
</object>
</property>
</template>
</interface>
]]></property>
</object>
</property>
<signal name="activate" handler="on_results_listview_activated_cb" object="GcalSearchButton" swapped="no" />
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+31
View File
@@ -0,0 +1,31 @@
using Gtk 4.0;
using Adw 1;
template $GcalSyncIndicator: Adw.Bin {
child: Stack stack {
transition-type: crossfade;
transition-duration: 250;
StackPage {
name: "empty";
child: Box {};
}
StackPage {
name: "spinner";
child: Adw.Spinner refreshing_spinner {
tooltip-text: C_("tooltip", "Synchronizing Remote Calendars");
};
}
StackPage {
name: "success";
child: Image success_image {
icon-name: "checkmark-small-symbolic";
};
}
};
}
-39
View File
@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalSyncIndicator" parent="AdwBin">
<property name="child">
<object class="GtkStack" id="stack">
<property name="transition-type">crossfade</property>
<property name="transition-duration">250</property>
<child>
<object class="GtkStackPage">
<property name="name">empty</property>
<property name="child">
<object class="GtkBox" />
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">spinner</property>
<property name="child">
<object class="AdwSpinner" id="refreshing_spinner">
<property name="tooltip_text" translatable="yes" context="tooltip">Synchronizing Remote Calendars</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">success</property>
<property name="child">
<object class="GtkImage" id="success_image">
<property name="icon_name">checkmark-small-symbolic</property>
</object>
</property>
</object>
</child>
</object>
</property>
</template>
</interface>
+47
View File
@@ -0,0 +1,47 @@
using Gtk 4.0;
template $GcalWeatherSettings: Box {
orientation: vertical;
margin-top: 12;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
spacing: 6;
Box {
spacing: 18;
Label {
hexpand: true;
xalign: 0.0;
label: _("Show Weather");
}
Switch show_weather_switch {
notify::active => $on_show_weather_changed_cb(template) not-swapped;
}
}
Box weather_auto_location_box {
spacing: 18;
Label {
hexpand: true;
xalign: 0.0;
label: _("Automatic Location");
}
Switch weather_auto_location_switch {
notify::active => $on_weather_auto_location_changed_cb(template) not-swapped;
}
}
Entry weather_location_entry {
placeholder-text: _("Search locations");
primary-icon-name: "edit-find-symbolic";
primary-icon-activatable: false;
primary-icon-sensitive: false;
changed => $on_weather_location_searchbox_changed_cb(template) not-swapped;
activate => $on_weather_location_searchbox_changed_cb(template) not-swapped;
}
}
-55
View File
@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalWeatherSettings" parent="GtkBox">
<property name="orientation">vertical</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>
<property name="spacing">6</property>
<child>
<object class="GtkBox">
<property name="spacing">18</property>
<child>
<object class="GtkLabel">
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
<property name="label" translatable="yes">Show Weather</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="show_weather_switch">
<signal name="notify::active" handler="on_show_weather_changed_cb" object="GcalWeatherSettings" swapped="no" />
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="weather_auto_location_box">
<property name="spacing">18</property>
<child>
<object class="GtkLabel">
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
<property name="label" translatable="yes">Automatic Location</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="weather_auto_location_switch">
<signal name="notify::active" handler="on_weather_auto_location_changed_cb" object="GcalWeatherSettings" swapped="no" />
</object>
</child>
</object>
</child>
<child>
<object class="GtkEntry" id="weather_location_entry">
<property name="placeholder-text" translatable="yes">Search locations</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
<signal name="changed" handler="on_weather_location_searchbox_changed_cb" object="GcalWeatherSettings" swapped="no" />
<signal name="activate" handler="on_weather_location_searchbox_changed_cb" object="GcalWeatherSettings" swapped="no" />
</object>
</child>
</template>
</interface>
+398
View File
@@ -0,0 +1,398 @@
using Gtk 4.0;
using Adw 1;
template $GcalWindow: Adw.ApplicationWindow {
title: _("Calendar");
default-width: 800;
default-height: 600;
width-request: 360;
height-request: 600;
ShortcutController {
Shortcut {
trigger: "<Control>t";
action: "action(win.today)";
}
Shortcut {
trigger: "<Alt>Down";
action: "action(win.today)";
}
Shortcut {
trigger: "Home";
action: "action(win.today)";
}
Shortcut {
trigger: "<Alt>Left";
action: "action(win.previous-date)";
}
Shortcut {
trigger: "Page_Up";
action: "action(win.previous-date)";
}
Shortcut {
trigger: "<Alt>Right";
action: "action(win.next-date)";
}
Shortcut {
trigger: "Page_Down";
action: "action(win.next-date)";
}
Shortcut {
trigger: "<Control>Page_Down";
action: "action(win.change-view)";
arguments: "-1";
}
Shortcut {
trigger: "<Control>Page_Up";
action: "action(win.change-view)";
arguments: "-2";
}
Shortcut {
trigger: "<Alt>1";
action: "action(win.change-view)";
arguments: "0";
}
Shortcut {
trigger: "<Alt>2";
action: "action(win.change-view)";
arguments: "1";
}
Shortcut {
trigger: "<Alt>3";
action: "action(win.change-view)";
arguments: "3";
}
Shortcut {
trigger: "<Ctrl>n";
action: "action(win.new-event)";
}
Shortcut {
trigger: "<Control>q";
action: "action(app.quit)";
}
Shortcut {
trigger: "<Ctrl><Alt>m";
action: "action(win.show-calendars)";
}
Shortcut {
trigger: "<Ctrl>r";
action: "action(app.sync)";
}
Shortcut {
trigger: "F5";
action: "action(app.sync)";
}
Shortcut {
trigger: "F8";
action: "action(win.show-calendars)";
}
}
Adw.ToastOverlay overlay {
$GcalDropOverlay drop_overlay {
overlayed: Adw.StatusPage drop_status_page {
title: _("Drop Event Files to Import");
icon-name: "calendar-month-symbolic";
styles [
"drop-overlay-area",
"compact",
]
};
child: Adw.OverlaySplitView split_view {
pin-sidebar: true;
show-sidebar: false;
DropTarget drop_target {
actions: copy;
propagation-phase: capture;
accept => $on_drop_target_accept_cb(template) not-swapped;
drop => $on_drop_target_drop_cb(template) not-swapped;
}
styles [
"drop-target",
]
sidebar: Adw.ToolbarView {
[top]
Adw.HeaderBar {}
content: Box {
orientation: vertical;
$GcalDateChooser date_chooser {
split-month-year: true;
vexpand: false;
active-date: bind template.active-date no-sync-create bidirectional;
day-selected => $day_selected(template);
}
$GcalCalendarList calendars_list {}
};
};
content: Adw.ToolbarView main_toolbar {
styles [
"view",
]
[top]
Adw.HeaderBar header_bar {
[start]
ToggleButton sidebar_button {
icon-name: "sidebar-show-symbolic";
tooltip-text: _("Toggle Sidebar");
active: bind split_view.show-sidebar bidirectional;
ShortcutController {
scope: managed;
Shortcut {
trigger: "F9";
action: "activate";
}
}
}
[start]
$GcalSyncIndicator sync_indicator {}
title-widget: $GcalCalendarNavigationButton navigation_button_title {
active-date: bind template.active-date no-sync-create bidirectional;
active: bind split_view.show-sidebar inverted;
};
[end]
MenuButton menu_button {
icon-name: "open-menu-symbolic";
popover: win_menu;
tooltip-text: _("Main Menu");
primary: true;
}
[end]
$GcalSearchButton search_button {
tooltip-text: C_("tooltip", "Search");
}
}
content: Adw.ViewStack views_stack {
hexpand: true;
vexpand: true;
notify::visible-child => $view_changed(template) not-swapped;
styles [
"view",
]
Adw.ViewStackPage month_page {
name: "month";
title: _("_Month");
use-underline: true;
icon-name: "calendar-month-symbolic";
child: $GcalMonthView month_view {
active-date: bind template.active-date no-sync-create bidirectional;
create-event => $show_new_event_widget(template) not-swapped;
create-event-detailed => $create_event_detailed_cb(template) not-swapped;
event-activated => $event_activated(template) not-swapped;
};
}
Adw.ViewStackPage week_page {
name: "week";
title: _("_Week");
use-underline: true;
icon-name: "calendar-week-symbolic";
child: $GcalWeekView week_view {
active-date: bind template.active-date no-sync-create bidirectional;
create-event => $show_new_event_widget(template) not-swapped;
event-activated => $event_activated(template) not-swapped;
};
}
Adw.ViewStackPage agenda_page {
name: "agenda";
title: _("_Agenda");
use-underline: true;
icon-name: "calendar-agenda-symbolic";
visible: false;
child: $GcalAgendaView agenda_view {
vexpand: true;
active-date: bind template.active-date no-sync-create bidirectional;
create-event => $show_new_event_widget(template) not-swapped;
event-activated => $event_activated(template) not-swapped;
};
}
};
[bottom]
ActionBar {
[start]
Button previous_date_button {
icon-name: "go-previous-symbolic";
action-name: "win.previous-date";
}
[start]
Button next_date_button {
icon-name: "go-next-symbolic";
action-name: "win.next-date";
}
[start]
Button {
action-name: "win.today";
child: Adw.ButtonContent {
label: _("_Today");
use-underline: true;
icon-name: "calendar-today-symbolic";
can-shrink: true;
tooltip-text: _("Go to Today");
};
}
[center]
Adw.Bin view_switcher_bin {
child: Adw.ViewSwitcher view_switcher_wide {
stack: views_stack;
policy: wide;
};
}
[end]
Button {
icon-name: "list-add-symbolic";
action-name: "win.new-event";
tooltip-text: C_("tooltip", "Add Event");
}
[end]
Button {
icon-name: "x-office-calendar-symbolic";
tooltip-text: _("Manage Calendars");
action-name: "win.show-calendars";
}
}
};
};
}
}
notify::current-breakpoint => $on_breakpoint_changed(template) not-swapped;
Adw.Breakpoint {
condition ("max-width: 1000sp")
setters {
split_view.collapsed: true;
view_switcher_bin.child: view_switcher_narrow;
}
}
Adw.Breakpoint {
condition ("max-width: 700sp")
setters {
split_view.collapsed: true;
view_switcher_bin.visible: false;
previous_date_button.visible: false;
next_date_button.visible: false;
split_view.show-sidebar: false;
sidebar_button.visible: false;
header_bar.title-widget: null;
navigation_button_title.active: false;
week_page.visible: false;
month_page.visible: false;
agenda_page.visible: true;
}
}
}
Adw.InlineViewSwitcher view_switcher_narrow {
styles [
"flat",
]
stack: views_stack;
display-mode: icons;
}
$GcalQuickAddPopover quick_add_popover {
edit-event => $edit_event(template) not-swapped;
closed => $close_new_event_widget(template) not-swapped;
}
$GcalEventEditorDialog event_editor {
remove-event => $on_event_editor_dialog_remove_event_cb(template) not-swapped;
}
menu menu {
section {
item {
label: _("_Synchronize Calendars");
action: "app.sync";
}
}
section {
item {
label: _("_Date & Time Settings…");
action: "win.open-date-time-settings";
}
item {
label: _("_Online Accounts…");
action: "win.open-online-accounts";
}
submenu {
label: _("Weather");
item {
custom: "weather";
}
}
}
section {
item {
label: _("_Keyboard Shortcuts");
action: "win.show-help-overlay";
}
item {
label: _("_About Calendar");
action: "app.about";
}
}
}
PopoverMenu win_menu {
menu-model: menu;
[weather]
$GcalWeatherSettings weather_settings {}
}
-454
View File
@@ -1,454 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalWindow" parent="AdwApplicationWindow">
<property name="title" translatable="yes">Calendar</property>
<property name="default_width">800</property>
<property name="default_height">600</property>
<property name="width_request">360</property>
<property name="height_request">600</property>
<!-- Shortcuts -->
<child>
<object class="GtkShortcutController">
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Control&gt;t</property>
<property name="action">action(win.today)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;Down</property>
<property name="action">action(win.today)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">Home</property>
<property name="action">action(win.today)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;Left</property>
<property name="action">action(win.previous-date)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">Page_Up</property>
<property name="action">action(win.previous-date)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;Right</property>
<property name="action">action(win.next-date)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">Page_Down</property>
<property name="action">action(win.next-date)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Control&gt;Page_Down</property>
<property name="action">action(win.change-view)</property>
<property name="arguments">-1</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Control&gt;Page_Up</property>
<property name="action">action(win.change-view)</property>
<property name="arguments">-2</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;1</property>
<property name="action">action(win.change-view)</property>
<property name="arguments">0</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;2</property>
<property name="action">action(win.change-view)</property>
<property name="arguments">1</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Alt&gt;3</property>
<property name="action">action(win.change-view)</property>
<property name="arguments">3</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Ctrl&gt;n</property>
<property name="action">action(win.new-event)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Control&gt;q</property>
<property name="action">action(app.quit)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Ctrl&gt;&lt;Alt&gt;m</property>
<property name="action">action(win.show-calendars)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">&lt;Ctrl&gt;r</property>
<property name="action">action(app.sync)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">F5</property>
<property name="action">action(app.sync)</property>
</object>
</child>
<child>
<object class="GtkShortcut">
<property name="trigger">F8</property>
<property name="action">action(win.show-calendars)</property>
</object>
</child>
</object>
</child>
<!-- Main Overlay -->
<child>
<object class="AdwToastOverlay" id="overlay">
<child>
<object class="GcalDropOverlay" id="drop_overlay">
<property name="overlayed">
<object class="AdwStatusPage" id="drop_status_page">
<property name="title" translatable="yes">Drop Event Files to Import</property>
<property name="icon-name">calendar-month-symbolic</property>
<style>
<class name="drop-overlay-area"/>
<class name="compact"/>
</style>
</object>
</property>
<property name="child">
<object class="AdwOverlaySplitView" id="split_view">
<property name="pin-sidebar">True</property>
<property name="show-sidebar">False</property>
<child>
<object class="GtkDropTarget" id="drop_target">
<property name="actions">copy</property>
<property name="propagation-phase">capture</property>
<signal name="accept" handler="on_drop_target_accept_cb" object="GcalWindow" swapped="no"/>
<signal name="drop" handler="on_drop_target_drop_cb" object="GcalWindow" swapped="no"/>
</object>
</child>
<style>
<class name="drop-target"/>
</style>
<!-- Sidebar -->
<property name="sidebar">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar" />
</child>
<property name="content">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GcalDateChooser" id="date_chooser">
<property name="split-month-year">True</property>
<property name="vexpand">False</property>
<property name="active-date" bind-source="GcalWindow" bind-property="active-date" bind-flags="bidirectional" />
<signal name="day-selected" handler="day_selected" object="GcalWindow" swapped="yes" />
</object>
</child>
<child>
<object class="GcalCalendarList" id="calendars_list" />
</child>
</object>
</property>
</object>
</property>
<!-- Main content -->
<property name="content">
<object class="AdwToolbarView" id="main_toolbar">
<style>
<class name="view" />
</style>
<child type="top">
<object class="AdwHeaderBar" id="header_bar">
<child type="start">
<object class="GtkToggleButton" id="sidebar_button">
<property name="icon-name">sidebar-show-symbolic</property>
<property name="tooltip-text" translatable="yes">Toggle Sidebar</property>
<property name="active" bind-source="split_view" bind-property="show-sidebar" bind-flags="sync-create | bidirectional" />
<child>
<object class="GtkShortcutController">
<property name="scope">managed</property>
<child>
<object class="GtkShortcut">
<property name="trigger">F9</property>
<property name="action">activate</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child type="start">
<object class="GcalSyncIndicator" id="sync_indicator" />
</child>
<property name="title-widget">
<object class="GcalCalendarNavigationButton" id="navigation_button_title">
<property name="active-date" bind-source="GcalWindow" bind-property="active-date" bind-flags="bidirectional" />
<property name="active" bind-source="split_view" bind-property="show-sidebar" bind-flags="sync-create | invert-boolean" />
</object>
</property>
<child type="end">
<object class="GtkMenuButton" id="menu_button">
<property name="icon-name">open-menu-symbolic</property>
<property name="popover">win_menu</property>
<property name="tooltip-text" translatable="yes">Main Menu</property>
<property name="primary">True</property>
</object>
</child>
<child type="end">
<object class="GcalSearchButton" id="search_button">
<property name="tooltip-text" translatable="yes" context="tooltip">Search</property>
</object>
</child>
</object>
</child>
<property name="content">
<object class="AdwViewStack" id="views_stack">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<signal name="notify::visible-child" handler="view_changed" object="GcalWindow" swapped="no" />
<style>
<class name="view" />
</style>
<child>
<object class="AdwViewStackPage" id="month_page">
<property name="name">month</property>
<property name="title" translatable="yes">_Month</property>
<property name="use-underline">True</property>
<property name="icon-name">calendar-month-symbolic</property>
<property name="child">
<object class="GcalMonthView" id="month_view">
<property name="active-date" bind-source="GcalWindow" bind-property="active-date" bind-flags="bidirectional" />
<signal name="create-event" handler="show_new_event_widget" object="GcalWindow" swapped="no" />
<signal name="create-event-detailed" handler="create_event_detailed_cb" object="GcalWindow" swapped="no" />
<signal name="event-activated" handler="event_activated" object="GcalWindow" swapped="no" />
</object>
</property>
</object>
</child>
<child>
<object class="AdwViewStackPage" id="week_page">
<property name="name">week</property>
<property name="title" translatable="yes">_Week</property>
<property name="use-underline">True</property>
<property name="icon-name">calendar-week-symbolic</property>
<property name="child">
<object class="GcalWeekView" id="week_view">
<property name="active-date" bind-source="GcalWindow" bind-property="active-date" bind-flags="bidirectional" />
<signal name="create-event" handler="show_new_event_widget" object="GcalWindow" swapped="no" />
<signal name="event-activated" handler="event_activated" object="GcalWindow" swapped="no" />
</object>
</property>
</object>
</child>
<child>
<object class="AdwViewStackPage" id="agenda_page">
<property name="name">agenda</property>
<property name="title" translatable="yes">_Agenda</property>
<property name="use-underline">True</property>
<property name="icon-name">calendar-agenda-symbolic</property>
<property name="visible">False</property>
<property name="child">
<object class="GcalAgendaView" id="agenda_view">
<property name="vexpand">True</property>
<property name="active-date" bind-source="GcalWindow" bind-property="active-date" bind-flags="bidirectional" />
<signal name="create-event" handler="show_new_event_widget" object="GcalWindow" swapped="no" />
<signal name="event-activated" handler="event_activated" object="GcalWindow" swapped="no" />
</object>
</property>
</object>
</child>
</object>
</property>
<child type="bottom">
<object class="GtkActionBar">
<child type="start">
<object class="GtkButton" id="previous_date_button">
<property name="icon-name">go-previous-symbolic</property>
<property name="action-name">win.previous-date</property>
</object>
</child>
<child type="start">
<object class="GtkButton" id="next_date_button">
<property name="icon-name">go-next-symbolic</property>
<property name="action-name">win.next-date</property>
</object>
</child>
<child type="start">
<object class="GtkButton">
<property name="action-name">win.today</property>
<property name="child">
<object class="AdwButtonContent">
<property name="label" translatable="yes">_Today</property>
<property name="use-underline">True</property>
<property name="icon-name">calendar-today-symbolic</property>
<property name="can-shrink">True</property>
<property name="tooltip-text" translatable="yes">Go to Today</property>
</object>
</property>
</object>
</child>
<child type="center">
<object class="AdwBin" id="view_switcher_bin">
<property name="child">
<object class="AdwViewSwitcher" id="view_switcher_wide">
<property name="stack">views_stack</property>
<property name="policy">wide</property>
</object>
</property>
</object>
</child>
<child type="end">
<object class="GtkButton">
<property name="icon-name">list-add-symbolic</property>
<property name="action-name">win.new-event</property>
<property name="tooltip-text" translatable="yes" context="tooltip">Add Event</property>
</object>
</child>
<child type="end">
<object class="GtkButton">
<property name="icon-name">x-office-calendar-symbolic</property>
<property name="tooltip-text" translatable="yes">Manage Calendars</property>
<property name="action-name">win.show-calendars</property>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</property>
</object>
</child>
</object>
</child>
<signal name="notify::current-breakpoint" handler="on_breakpoint_changed" object="GcalWindow" swapped="no" />
<child>
<object class="AdwBreakpoint">
<condition>max-width: 1000sp</condition>
<setter object="split_view" property="collapsed">True</setter>
<setter object="view_switcher_bin" property="child">view_switcher_narrow</setter>
</object>
</child>
<child>
<object class="AdwBreakpoint">
<condition>max-width: 700sp</condition>
<setter object="split_view" property="collapsed">True</setter>
<setter object="view_switcher_bin" property="visible">False</setter> <!-- set child to view_switcher_narrow here once there are multiple mobile-friendly views -->
<setter object="previous_date_button" property="visible">False</setter>
<setter object="next_date_button" property="visible">False</setter>
<setter object="split_view" property="show-sidebar">False</setter>
<setter object="sidebar_button" property="visible">False</setter>
<!-- remove once agenda view no longer needs always visible date chooser -->
<setter object="header_bar" property="title-widget"></setter>
<setter object="navigation_button_title" property="active">False</setter>
<!-- only make views optimised for certain width visible here -->
<setter object="week_page" property="visible">False</setter>
<setter object="month_page" property="visible">False</setter>
<setter object="agenda_page" property="visible">True</setter>
</object>
</child>
</template>
<object class="AdwInlineViewSwitcher" id="view_switcher_narrow">
<style>
<class name="flat" />
</style>
<property name="stack">views_stack</property>
<property name="display-mode">icons</property>
</object>
<object class="GcalQuickAddPopover" id="quick_add_popover">
<signal name="edit-event" handler="edit_event" object="GcalWindow" swapped="no"/>
<signal name="closed" handler="close_new_event_widget" object="GcalWindow" swapped="no"/>
</object>
<object class="GcalEventEditorDialog" id="event_editor">
<signal name="remove-event" handler="on_event_editor_dialog_remove_event_cb" object="GcalWindow" swapped="no"/>
</object>
<menu id='menu'>
<section>
<item>
<attribute name="label" translatable="yes">_Synchronize Calendars</attribute>
<attribute name="action">app.sync</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Date &amp; Time Settings…</attribute>
<attribute name="action">win.open-date-time-settings</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Online Accounts…</attribute>
<attribute name="action">win.open-online-accounts</attribute>
</item>
<submenu>
<attribute name="label" translatable="yes">Weather</attribute>
<item>
<attribute name="custom">weather</attribute>
</item>
</submenu>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Calendar</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
<object class="GtkPopoverMenu" id="win_menu">
<property name="menu-model">menu</property>
<!-- Weather submenu -->
<child type="weather">
<object class="GcalWeatherSettings" id="weather_settings" />
</child>
</object>
</interface>
+102
View File
@@ -0,0 +1,102 @@
using Gtk 4.0;
ShortcutsWindow help_overlay {
modal: true;
ShortcutsSection {
section-name: "shortcuts";
max-height: 17;
ShortcutsGroup {
title: C_("shortcut window", "General");
ShortcutsShortcut {
title: C_("shortcut window", "Open Main Menu");
accelerator: "F10";
}
ShortcutsShortcut {
title: C_("shortcut window", "Open Calendars Menu");
accelerator: "F8";
}
ShortcutsShortcut {
title: C_("shortcut window", "New Event");
accelerator: "<Primary>N";
}
ShortcutsShortcut {
title: C_("shortcut window", "Manage Calendars");
accelerator: "<Ctrl><Alt>m";
}
ShortcutsShortcut {
title: C_("shortcut window", "Synchronize Calendars");
accelerator: "F5 <Ctrl>r";
}
ShortcutsShortcut {
title: C_("shortcut window", "Close Window");
accelerator: "<Primary>Q";
}
ShortcutsShortcut {
title: C_("shortcut window", "Search");
accelerator: "<Primary>F";
}
ShortcutsShortcut {
title: C_("shortcut window", "Show Help");
accelerator: "F1";
}
ShortcutsShortcut {
title: C_("shortcut window", "Shortcuts");
accelerator: "<Primary>question";
}
}
ShortcutsGroup {
title: C_("shortcut window", "Navigation");
ShortcutsShortcut {
title: C_("shortcut window", "Go Back");
accelerator: "<Alt>Left Page_Up";
}
ShortcutsShortcut {
title: C_("shortcut window", "Go Forward");
accelerator: "<Alt>Right Page_Down";
}
ShortcutsShortcut {
title: C_("shortcut window", "Show Today");
accelerator: "<Alt>Down <Primary>T Home";
}
ShortcutsShortcut {
title: C_("shortcut window", "Next View");
accelerator: "<Primary>Page_Down";
}
ShortcutsShortcut {
title: C_("shortcut window", "Previous View");
accelerator: "<Primary>Page_Up";
}
}
ShortcutsGroup {
title: C_("shortcut window", "View");
ShortcutsShortcut {
title: C_("shortcut window", "Week View");
accelerator: "<Alt>1";
}
ShortcutsShortcut {
title: C_("shortcut window", "Month View");
accelerator: "<Alt>2";
}
}
}
}
-123
View File
@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="help_overlay">
<property name="modal">True</property>
<child>
<object class="GtkShortcutsSection">
<property name="section-name">shortcuts</property>
<property name="max-height">17</property>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">General</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Open Main Menu</property>
<property name="accelerator">F10</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Open Calendars Menu</property>
<property name="accelerator">F8</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">New Event</property>
<property name="accelerator">&lt;Primary&gt;N</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Manage Calendars</property>
<property name="accelerator">&lt;Ctrl&gt;&lt;Alt&gt;m</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Synchronize Calendars</property>
<property name="accelerator">F5 &lt;Ctrl&gt;r</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Close Window</property>
<property name="accelerator">&lt;Primary&gt;Q</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Search</property>
<property name="accelerator">&lt;Primary&gt;F</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Show Help</property>
<property name="accelerator">F1</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Shortcuts</property>
<property name="accelerator">&lt;Primary&gt;question</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">Navigation</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Go Back</property>
<property name="accelerator">&lt;Alt&gt;Left Page_Up</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Go Forward</property>
<property name="accelerator">&lt;Alt&gt;Right Page_Down</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Show Today</property>
<property name="accelerator">&lt;Alt&gt;Down &lt;Primary&gt;T Home</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Next View</property>
<property name="accelerator">&lt;Primary&gt;Page_Down</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Previous View</property>
<property name="accelerator">&lt;Primary&gt;Page_Up</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">View</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Week View</property>
<property name="accelerator">&lt;Alt&gt;1</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="title" translatable="yes" context="shortcut window">Month View</property>
<property name="accelerator">&lt;Alt&gt;2</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+16
View File
@@ -1,5 +1,21 @@
blueprints = custom_target(
'blueprints',
input: files(
'help-overlay.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'gtk-resources',
'gtk.gresource.xml',
c_name: 'gtk',
dependencies: blueprints,
)
+78
View File
@@ -0,0 +1,78 @@
using Gtk 4.0;
using Adw 1;
template $GcalImportDialog: Adw.Dialog {
title: _("Import Files…");
height-request: 294;
follows-content-size: true;
Adw.ToastOverlay toast_overlay {
Adw.ToolbarView {
[top]
Adw.HeaderBar headerbar {
show-end-title-buttons: false;
show-start-title-buttons: false;
[start]
Button cancel_button {
label: _("_Cancel");
use-underline: true;
action-name: "sheet.close";
}
[end]
Button import_button {
label: _("_Import");
use-underline: true;
clicked => $on_import_button_clicked_cb(template) not-swapped;
styles [
"suggested-action",
]
}
}
content: ScrolledWindow {
propagate-natural-height: true;
propagate-natural-width: true;
Adw.Clamp {
margin-top: 24;
margin-bottom: 24;
margin-start: 12;
margin-end: 12;
Box calendars_box {
orientation: vertical;
spacing: 18;
Adw.PreferencesGroup {
$GcalCalendarComboRow calendar_combo_row {
title: _("C_alendar");
use-underline: true;
}
}
Adw.PreferencesGroup files_group {
Adw.Spinner placeholder_spinner {
halign: center;
valign: center;
}
}
}
}
};
}
}
ShortcutController {
Shortcut {
trigger: "Escape";
action: "action(sheet.close)";
}
}
}
SizeGroup title_sizegroup {
mode: horizontal;
}
-110
View File
@@ -1,110 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalImportDialog" parent="AdwDialog">
<property name="title" translatable="yes">Import Files…</property>
<property name="height-request">294</property>
<property name="follows-content-size">True</property>
<child>
<object class="AdwToastOverlay" id="toast_overlay">
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar" id="headerbar">
<property name="show-end-title-buttons">False</property>
<property name="show-start-title-buttons">False</property>
<!-- Cancel button -->
<child type="start">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="use-underline">True</property>
<property name="action-name">sheet.close</property>
</object>
</child>
<!-- Import button -->
<child type="end">
<object class="GtkButton" id="import_button">
<property name="label" translatable="yes">_Import</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_import_button_clicked_cb" object="GcalImportDialog" swapped="no" />
<style>
<class name="suggested-action" />
</style>
</object>
</child>
</object>
</child>
<property name="content">
<object class="GtkScrolledWindow">
<property name="propagate-natural-height">True</property>
<property name="propagate-natural-width">True</property>
<child>
<object class="AdwClamp">
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<child>
<object class="GtkBox" id="calendars_box">
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<!-- Calendar -->
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="GcalCalendarComboRow" id="calendar_combo_row">
<property name="title" translatable="yes">C_alendar</property>
<property name="use-underline">True</property>
</object>
</child>
</object>
</child>
<!-- Files overview -->
<child>
<object class="AdwPreferencesGroup" id="files_group">
<child>
<object class="AdwSpinner" id="placeholder_spinner">
<property name="halign">center</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</child>
<!-- Shortcuts -->
<child>
<object class="GtkShortcutController">
<child>
<object class="GtkShortcut">
<property name="trigger">Escape</property>
<property name="action">action(sheet.close)</property>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup" id="title_sizegroup">
<property name="mode">horizontal</property>
</object>
</interface>
+12
View File
@@ -0,0 +1,12 @@
using Gtk 4.0;
using Adw 1;
template $GcalImportFileRow: Adw.Bin {
ListBox events_listbox {
selection-mode: none;
styles [
"boxed-list",
]
}
}
-16
View File
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalImportFileRow" parent="AdwBin">
<!-- Event preview listbox -->
<child>
<object class="GtkListBox" id="events_listbox">
<property name="selection-mode">none</property>
<style>
<class name="boxed-list" />
</style>
</object>
</child>
</template>
</interface>
+17
View File
@@ -1,9 +1,26 @@
calendar_incs += include_directories('.')
blueprints = custom_target(
'blueprints',
input: files(
'gcal-import-dialog.blp',
'gcal-import-file-row.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'importer-resources',
'importer.gresource.xml',
c_name: 'importer',
dependencies: blueprints,
)
sources += files(
+25
View File
@@ -8,10 +8,35 @@ subdir('views')
calendar_incs += include_directories('.')
blueprints = custom_target(
'blueprints',
input: files(
'gcal-calendar-list.blp',
'gcal-calendar-navigation-button.blp',
'gcal-event-popover.blp',
'gcal-event-widget.blp',
'gcal-meeting-row.blp',
'gcal-quick-add-popover.blp',
'gcal-search-button.blp',
'gcal-sync-indicator.blp',
'gcal-weather-settings.blp',
'gcal-window.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'gui-resources',
'gui.gresource.xml',
c_name: 'gui',
dependencies: blueprints,
)
sources += files(
+38
View File
@@ -0,0 +1,38 @@
using Gtk 4.0;
template $GcalAgendaView: Box {
orientation: vertical;
$GcalDateChooser date_chooser {
split-month-year: false;
vexpand: false;
valign: end;
active-date: bind template.active-date no-sync-create bidirectional;
}
ScrolledWindow scrolled_window {
hexpand: true;
vexpand: true;
ListBox list_box {
hexpand: true;
selection-mode: none;
vexpand: true;
row-activated => $on_list_box_row_activated_cb(template) not-swapped;
ListBoxRow no_events_row {
activatable: false;
child: Label {
label: _("No events");
xalign: 0;
styles [
"no-events",
"dim-label",
]
};
}
}
}
}
-43
View File
@@ -1,43 +0,0 @@
<?xml version="1.0"?>
<interface>
<template class="GcalAgendaView" parent="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GcalDateChooser" id="date_chooser">
<property name="split-month-year">False</property>
<property name="vexpand">False</property>
<property name="valign">end</property>
<property name="active-date" bind-source="GcalAgendaView" bind-property="active-date" bind-flags="bidirectional" />
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkListBox" id="list_box">
<property name="hexpand">True</property>
<property name="selection-mode">none</property>
<property name="vexpand">True</property>
<signal name="row-activated" handler="on_list_box_row_activated_cb" object="GcalAgendaView" swapped="no" />
<child>
<object class="GtkListBoxRow" id="no_events_row">
<property name="activatable">False</property>
<property name="child">
<object class="GtkLabel">
<property name="label" translatable="yes">No events</property>
<property name="xalign">0</property>
<style>
<class name="no-events" />
<class name="dim-label" />
</style>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+75
View File
@@ -0,0 +1,75 @@
using Gtk 4.0;
using Adw 1;
template $GcalMonthCell: Adw.BreakpointBin {
Adw.Breakpoint breakpoint_narrow {
condition ("max-width: 120sp")
setters {
weather_icon.halign: end;
weather_icon.hexpand: true;
weather_icon.margin-start: 6;
temp_label.visible: false;
}
}
width-request: 50;
height-request: 50;
hexpand: true;
vexpand: true;
focusable: true;
Overlay overlay {
[overlay]
Box header_box {
valign: start;
spacing: 6;
margin-top: 6;
margin-bottom: 6;
margin-start: 6;
margin-end: 6;
Label day_label {
styles [
"day-label",
"numeric",
]
}
Label month_name_label {}
Image weather_icon {
pixel-size: 16;
margin-start: 12;
styles [
"dim-label",
]
}
Label temp_label {
styles [
"dim-label",
"temp-label",
]
}
}
[overlay]
Button overflow_button {
valign: end;
sensitive: false;
clicked => $overflow_button_clicked_cb(template) not-swapped;
styles [
"flat",
]
Box {
Inscription overflow_inscription {
text-overflow: ellipsize_end;
}
}
}
}
}
-87
View File
@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthCell" parent="AdwBreakpointBin">
<child>
<object class="AdwBreakpoint" id="breakpoint_narrow">
<condition>max-width: 120sp</condition>
<setter object="weather_icon" property="halign">end</setter>
<setter object="weather_icon" property="hexpand">True</setter>
<setter object="weather_icon" property="margin-start">6</setter>
<setter object="temp_label" property="visible">False</setter>
</object>
</child>
<property name="width-request">50</property>
<property name="height-request">50</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="focusable">True</property>
<child>
<object class="GtkOverlay" id="overlay">
<child type="overlay">
<object class="GtkBox" id="header_box">
<property name="valign">start</property>
<property name="spacing">6</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>
<child>
<object class="GtkLabel" id="day_label">
<style>
<class name="day-label" />
<class name="numeric" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="month_name_label" />
</child>
<!-- Weather forecast -->
<child>
<object class="GtkImage" id="weather_icon">
<property name="pixel_size">16</property>
<property name="margin-start">12</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="temp_label">
<style>
<class name="dim-label" />
<class name="temp-label" />
</style>
</object>
</child>
</object>
</child>
<child type="overlay">
<object class="GtkButton" id="overflow_button">
<property name="valign">end</property>
<property name="sensitive">False</property>
<signal name="clicked" handler="overflow_button_clicked_cb" object="GcalMonthCell" swapped="no" />
<style>
<class name="flat" />
</style>
<child>
<object class="GtkBox">
<child>
<object class="GtkInscription" id="overflow_inscription">
<property name="text-overflow">ellipsize-end</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+64
View File
@@ -0,0 +1,64 @@
using Gtk 4.0;
template $GcalMonthPopover: Widget {
visible: false;
ShortcutController {
Shortcut {
trigger: "Escape";
action: "action(month-popover.popdown)";
}
}
Box main_box {
orientation: vertical;
spacing: 12;
styles [
"card",
"view",
]
Box {
Label day_label {
label: "12";
xalign: 0.0;
hexpand: true;
styles [
"large-title",
]
}
Button {
halign: end;
valign: start;
icon-name: "window-close-symbolic";
clicked => $close_button_clicked_cb(template);
styles [
"flat",
"circular",
]
}
}
ListBox listbox {
vexpand: true;
selection-mode: none;
styles [
"calendar-list",
]
}
Button new_event_button {
label: _("New Event…");
clicked => $new_event_button_clicked_cb(template) not-swapped;
styles [
"flat",
]
}
}
}
-80
View File
@@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthPopover" parent="GtkWidget">
<property name="visible">False</property>
<child>
<object class="GtkShortcutController">
<child>
<object class="GtkShortcut">
<property name="trigger">Escape</property>
<property name="action">action(month-popover.popdown)</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="main_box">
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="card" />
<class name="view" />
</style>
<!-- Day label & close button-->
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="day_label">
<property name="label">12</property>
<property name="xalign">0.0</property>
<property name="hexpand">true</property>
<style>
<class name="large-title" />
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="halign">end</property>
<property name="valign">start</property>
<property name="icon-name">window-close-symbolic</property>
<signal name="clicked" handler="close_button_clicked_cb" object="GcalMonthPopover" swapped="yes" />
<style>
<class name="flat" />
<class name="circular" />
</style>
</object>
</child>
</object>
</child>
<!-- Event list -->
<child>
<object class="GtkListBox" id="listbox">
<property name="vexpand">True</property>
<property name="selection-mode">none</property>
<style>
<class name="calendar-list" />
</style>
</object>
</child>
<!-- New Event button -->
<child>
<object class="GtkButton" id="new_event_button">
<property name="label" translatable="yes">New Event…</property>
<signal name="clicked" handler="new_event_button_clicked_cb" object="GcalMonthPopover" swapped="no" />
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</template>
</interface>
+109
View File
@@ -0,0 +1,109 @@
using Gtk 4.0;
template $GcalMonthView: Widget {
overflow: hidden;
EventControllerScroll {
flags: vertical | kinetic;
scroll-begin => $on_scroll_controller_scroll_begin_cb(template) not-swapped;
scroll => $on_scroll_controller_scroll_cb(template) not-swapped;
scroll-end => $on_scroll_controller_scroll_end_cb(template) not-swapped;
decelerate => $on_scroll_controller_decelerate_cb(template) not-swapped;
}
EventControllerScroll {
flags: vertical | discrete;
scroll => $on_discrete_scroll_controller_scroll_cb(template) not-swapped;
}
GestureClick {
button: 1;
pressed => $on_click_gesture_pressed_cb(template) not-swapped;
released => $on_click_gesture_released_cb(template) not-swapped;
}
EventControllerMotion motion_controller {
propagation-phase: none;
motion => $on_motion_controller_motion_cb(template) not-swapped;
}
[header]
Box {
styles [
"month-header",
"view",
]
homogeneous: true;
Label label_0 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_1 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_2 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_3 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_4 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_5 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
Label label_6 {
margin-start: 6;
hexpand: true;
xalign: 0.0;
styles [
"header",
]
}
}
}
-126
View File
@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalMonthView" parent="GtkWidget">
<property name="overflow">hidden</property>
<child>
<object class="GtkEventControllerScroll">
<property name="flags">vertical|kinetic</property>
<signal name="scroll-begin" handler="on_scroll_controller_scroll_begin_cb" object="GcalMonthView" swapped="no" />
<signal name="scroll" handler="on_scroll_controller_scroll_cb" object="GcalMonthView" swapped="no" />
<signal name="scroll-end" handler="on_scroll_controller_scroll_end_cb" object="GcalMonthView" swapped="no" />
<signal name="decelerate" handler="on_scroll_controller_decelerate_cb" object="GcalMonthView" swapped="no" />
</object>
</child>
<child>
<object class="GtkEventControllerScroll">
<property name="flags">vertical|discrete</property>
<signal name="scroll" handler="on_discrete_scroll_controller_scroll_cb" object="GcalMonthView" swapped="no" />
</object>
</child>
<child>
<object class="GtkGestureClick">
<property name="button">1</property>
<signal name="pressed" handler="on_click_gesture_pressed_cb" object="GcalMonthView" swapped="no" />
<signal name="released" handler="on_click_gesture_released_cb" object="GcalMonthView" swapped="no" />
</object>
</child>
<child>
<object class="GtkEventControllerMotion" id="motion_controller">
<property name="propagation-phase">none</property>
<signal name="motion" handler="on_motion_controller_motion_cb" object="GcalMonthView" swapped="no" />
</object>
</child>
<!-- Header -->
<child type="header">
<object class="GtkBox">
<style>
<class name="month-header" />
<class name="view" />
</style>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label_0">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_1">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_2">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_3">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_4">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_5">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label_6">
<property name="margin-start">6</property>
<property name="hexpand">true</property>
<property name="xalign">0.0</property>
<style>
<class name="header" />
</style>
</object>
</child>
</object>
</child>
</template>
</interface>
+49
View File
@@ -0,0 +1,49 @@
using Gtk 4.0;
template $GcalWeekHeader: Widget {
Box main_box {
hexpand: true;
vexpand: false;
orientation: vertical;
styles [
"week-header",
]
Box {
orientation: vertical;
GestureClick {
button: 1;
pressed => $on_button_pressed(template) not-swapped;
released => $on_button_released(template) not-swapped;
}
EventControllerMotion motion_controller {
propagation-phase: none;
motion => $on_motion_notify(template) not-swapped;
}
Box weekdays_box {
homogeneous: true;
}
ScrolledWindow scrolledwindow {
hscrollbar-policy: never;
vscrollbar-policy: never;
propagate-natural-height: true;
margin-bottom: 2;
Viewport {
Grid grid {
column-homogeneous: true;
hexpand: true;
column-spacing: 6;
row-spacing: 2;
margin-start: 6;
}
}
}
}
}
}
-68
View File
@@ -1,68 +0,0 @@
<?xml version="1.0"?>
<interface>
<template class="GcalWeekHeader" parent="GtkWidget">
<child>
<object class="GtkBox" id="main_box">
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<property name="orientation">vertical</property>
<style>
<class name="week-header" />
</style>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<!-- Gestures -->
<child>
<object class="GtkGestureClick">
<property name="button">1</property>
<signal name="pressed" handler="on_button_pressed" object="GcalWeekHeader" swapped="no" />
<signal name="released" handler="on_button_released" object="GcalWeekHeader" swapped="no" />
</object>
</child>
<child>
<object class="GtkEventControllerMotion" id="motion_controller">
<property name="propagation-phase">none</property>
<signal name="motion" handler="on_motion_notify" object="GcalWeekHeader" swapped="no" />
</object>
</child>
<child>
<object class="GtkBox" id="weekdays_box">
<property name="homogeneous">True</property>
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="hscrollbar-policy">never</property>
<property name="vscrollbar-policy">never</property>
<property name="propagate-natural-height">True</property>
<property name="margin-bottom">2</property>
<child>
<object class="GtkViewport">
<child>
<object class="GtkGrid" id="grid">
<property name="column-homogeneous">True</property>
<property name="hexpand">True</property>
<property name="column-spacing">6</property>
<property name="row-spacing">2</property>
<property name="margin-start">6</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
+89
View File
@@ -0,0 +1,89 @@
using Gtk 4.0;
template $GcalWeekView: Box {
orientation: vertical;
styles [
"week-view",
]
Box {
orientation: horizontal;
Box expand_button_box {
hexpand: false;
ToggleButton {
visible: bind header.can-expand;
active: bind header.expanded bidirectional;
hexpand: true;
halign: center;
valign: end;
margin-bottom: 6;
icon-name: "go-down-symbolic";
styles [
"flat",
"circular",
"week-header-expander",
]
}
}
$GcalWeekHeader header {
hexpand: true;
event-activated => $on_event_activated(template);
}
}
Separator {}
ScrolledWindow scrolled_window {
hexpand: true;
vexpand: true;
GestureZoom {
scale-changed => $on_zoom_gesture_scale_changed_cb(template) not-swapped;
begin => $on_zoom_gesture_begin_cb(template) not-swapped;
end => $on_zoom_gesture_end_cb(template) not-swapped;
}
EventControllerScroll {
propagation-phase: capture;
flags: vertical | kinetic;
scroll-begin => $on_scroll_controller_scroll_begin_cb(template) not-swapped;
scroll => $on_scroll_controller_scroll_cb(template) not-swapped;
scroll-end => $on_scroll_controller_scroll_end_cb(template) not-swapped;
}
EventControllerMotion {
propagation-phase: capture;
enter => $on_motion_controller_enter_cb(template) not-swapped;
motion => $on_motion_controller_motion_cb(template) not-swapped;
leave => $on_motion_controller_leave_cb(template) not-swapped;
}
Viewport {
Box content {
orientation: horizontal;
$GcalWeekHourBar hours_bar {}
$GcalWeekGrid week_grid {
hexpand: true;
vexpand: true;
event-activated => $on_event_activated(template);
}
}
}
}
}
SizeGroup sizegroup {
mode: horizontal;
widgets [
expand_button_box,
hours_bar,
]
}
-116
View File
@@ -1,116 +0,0 @@
<?xml version="1.0"?>
<interface>
<template class="GcalWeekView" parent="GtkBox">
<property name="orientation">vertical</property>
<style>
<class name="week-view" />
</style>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<!-- Expand / Collapse button -->
<child>
<object class="GtkBox" id="expand_button_box">
<property name="hexpand">False</property>
<child>
<object class="GtkToggleButton">
<property name="visible" bind-source="header" bind-property="can-expand" bind-flags="sync-create" />
<property name="active" bind-source="header" bind-property="expanded" bind-flags="sync-create|bidirectional" />
<property name="hexpand">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
<property name="margin-bottom">6</property>
<property name="icon-name">go-down-symbolic</property>
<style>
<class name="flat" />
<class name="circular" />
<class name="week-header-expander" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GcalWeekHeader" id="header">
<property name="hexpand">True</property>
<signal name="event-activated" handler="on_event_activated" object="GcalWeekView" swapped="yes" />
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator" />
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<!-- Zoom Gesture -->
<child>
<object class="GtkGestureZoom">
<signal name="scale-changed" handler="on_zoom_gesture_scale_changed_cb" object="GcalWeekView" swapped="no" />
<signal name="begin" handler="on_zoom_gesture_begin_cb" object="GcalWeekView" swapped="no" />
<signal name="end" handler="on_zoom_gesture_end_cb" object="GcalWeekView" swapped="no" />
</object>
</child>
<!-- Scroll Event Controller -->
<child>
<object class="GtkEventControllerScroll">
<property name="propagation-phase">capture</property>
<property name="flags">vertical|kinetic</property>
<signal name="scroll-begin" handler="on_scroll_controller_scroll_begin_cb" object="GcalWeekView" swapped="no" />
<signal name="scroll" handler="on_scroll_controller_scroll_cb" object="GcalWeekView" swapped="no" />
<signal name="scroll-end" handler="on_scroll_controller_scroll_end_cb" object="GcalWeekView" swapped="no" />
</object>
</child>
<!-- Motion Event Controller -->
<child>
<object class="GtkEventControllerMotion">
<property name="propagation-phase">capture</property>
<signal name="enter" handler="on_motion_controller_enter_cb" object="GcalWeekView" swapped="no" />
<signal name="motion" handler="on_motion_controller_motion_cb" object="GcalWeekView" swapped="no" />
<signal name="leave" handler="on_motion_controller_leave_cb" object="GcalWeekView" swapped="no" />
</object>
</child>
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox" id="content">
<property name="orientation">horizontal</property>
<child>
<object class="GcalWeekHourBar" id="hours_bar">
</object>
</child>
<child>
<object class="GcalWeekGrid" id="week_grid">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<signal name="event-activated" handler="on_event_activated" object="GcalWeekView" swapped="yes" />
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup" id="sizegroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="expand_button_box" />
<widget name="hours_bar" />
</widgets>
</object>
</interface>
+21
View File
@@ -1,9 +1,30 @@
calendar_incs += include_directories('.')
blueprints = custom_target(
'blueprints',
input: files(
'gcal-agenda-view.blp',
'gcal-month-cell.blp',
'gcal-month-popover.blp',
'gcal-month-view.blp',
'gcal-week-header.blp',
'gcal-week-view.blp',
),
output: '.',
command: [
find_program('blueprint-compiler'),
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)
built_sources += gnome.compile_resources(
'views-resources',
'views.gresource.xml',
c_name: 'views',
dependencies: blueprints,
)
sources += files(