Files
federated-calendar/src/gui/gcal-window.ui
T
Henrique F. Simões e6b3e72e7c window: Add mnemonics to today, week and month labels
Users should be able to navigate through the interface ideally using
only the keyboard, as specified in the GNOME Human Interface Guidelines.
This however is currently possible in the window page with shortcuts
when it comes to switching among week and month views, and jumping to
today's date. It is also interesting to have access keys attached to
such labels, so that the user does not need to look for the keyboard
shortcuts.

Using the first letter for each of the labels as mnemonics suffices in
this case, since there is no conflict, none of them is a thin letter nor
has descenders, and they are easy to remember.
2022-11-20 19:54:52 +00:00

309 lines
14 KiB
XML

<?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="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;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>
</object>
</child>
<!-- Main Overlay -->
<child>
<object class="AdwToastOverlay" id="overlay">
<child>
<object class="AdwLeaflet" id="leaflet">
<property name="homogeneous">False</property>
<child>
<object class="GtkBox">
<property name="hexpand">False</property>
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-end-title-buttons" bind-source="leaflet" bind-property="folded" bind-flags="sync-create"/>
<property name="title-widget">
<object class="GcalCalendarButton" id="calendars_button" />
</property>
<child type="end">
<object class="GtkMenuButton" id="menu_button">
<property name="icon-name">open-menu-symbolic</property>
<property name="popover">win_menu</property>
</object>
</child>
</object>
</child>
<child>
<object class="GcalDateChooser" id="date_chooser">
<property name="split-month-year">False</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"/>
<style>
<class name="view"/>
</style>
</object>
</child>
<child>
<object class="GtkSeparator"/>
</child>
<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"/>
<style>
<class name="view"/>
</style>
</object>
</child>
<child>
<object class="GtkActionBar" id="action_bar">
<property name="revealed" bind-source="leaflet" bind-property="folded" bind-flags="sync-create"/>
<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>
</object>
</property>
</object>
</child>
<child type="end">
<object class="GcalToolbarEnd"/>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwLeafletPage">
<property name="navigatable">True</property>
<property name="child">
<object class="GtkSeparator"/>
</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar" id="header_bar">
<property name="show-start-title-buttons" bind-source="leaflet" bind-property="folded" bind-flags="sync-create"/>
<child>
<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>
</object>
</property>
</object>
</child>
<child type="title">
<object class="AdwViewSwitcher" id="views_switcher">
<property name="stack">views_stack</property>
<property name="policy">wide</property>
</object>
</child>
<child type="end">
<object class="GcalToolbarEnd"/>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="main_box">
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<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">
<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">
<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>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<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="GcalCalendarManagementDialog" id="calendar_management_dialog">
<property name="visible">False</property>
<property name="transient_for">GcalWindow</property>
</object>
<object class="GcalEventEditorDialog" id="event_editor">
<property name="visible">False</property>
<property name="transient_for">GcalWindow</property>
<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">_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>