<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.14"/>
  <template class="GcalWindow" parent="GtkApplicationWindow">
    <property name="window_position">center</property>
    <property name="default_width">800</property>
    <property name="default_height">600</property>
    <property name="height_request">600</property>
    <property name="show_menubar">False</property>
    <signal name="key-press-event" handler="key_pressed" object="GcalWindow" swapped="no"/>
    <signal name="window-state-event" handler="window_state_changed" object="GcalWindow" swapped="no"/>
    <property name="active-date" bind-source="search_view" bind-property="active-date" bind-flags="default|sync-create"/>
    <child>
      <object class="GtkOverlay" id="views_overlay">
        <property name="visible">True</property>
        <child>
          <object class="GtkBox" id="main_box">
            <property name="visible">True</property>
            <property name="hexpand">True</property>
            <property name="vexpand">True</property>
            <property name="orientation">vertical</property>
            <child>
              <object class="GtkSearchBar" id="search_bar">
                <property name="visible">True</property>
                <property name="hexpand">True</property>
                <property name="show_close_button">True</property>
                <property name="search-mode-enabled" bind-source="search_button" bind-property="active" bind-flags="bidirectional"/>
                <signal name="notify::search-mode-enabled" handler="search_toggled" object="GcalWindow" swapped="no"/>
                <child>
                  <object class="GtkSearchEntry" id="search_entry">
                    <property name="width_request">500</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="halign">center</property>
                    <property name="hexpand">True</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="search-changed" handler="search_changed" object="GcalWindow" swapped="no"/>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkStack" id="views_stack">
                <property name="visible">True</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <property name="transition_duration">250</property>
                <property name="transition_type">crossfade</property>
                <signal name="notify::visible-child" handler="view_changed" object="GcalWindow" swapped="no"/>
                <style>
                  <class name="view"/>
                </style>
                <child>
                  <object class="GcalWeekView" id="week_view">
                    <property name="visible">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>
                  <packing>
                    <property name="name">week</property>
                    <property name="title" translatable="yes">Week</property>
                  </packing>
                </child>
                <child>
                  <object class="GcalMonthView" id="month_view">
                    <property name="visible">True</property>
                    <property name="can_focus">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="create-event-detailed" handler="create_event_detailed_cb" object="GcalWindow" swapped="no"/>
                    <signal name="event-activated" handler="event_activated" object="GcalWindow" swapped="no"/>
                  </object>
                  <packing>
                    <property name="position">1</property>
                    <property name="name">month</property>
                    <property name="title" translatable="yes">Month</property>
                  </packing>
                </child>
                <child>
                  <object class="GcalYearView" id="year_view">
                    <property name="visible">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="create-event-detailed" handler="create_event_detailed_cb" object="GcalWindow" swapped="no"/>
                    <signal name="event-activated" handler="event_activated" object="GcalWindow" swapped="no"/>
                  </object>
                  <packing>
                    <property name="position">2</property>
                    <property name="name">year</property>
                    <property name="title" translatable="yes">Year</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="overlay">
          <object class="GtkRevealer" id="notification">
            <property name="visible">True</property>
            <property name="halign">center</property>
            <property name="valign">start</property>
            <property name="transition_duration">100</property>
            <signal name="notify::child-revealed" handler="remove_event" object="GcalWindow" swapped="no"/>
            <child>
              <object class="GtkFrame">
                <property name="visible">True</property>
                <child>
                  <object class="GtkGrid">
                    <property name="visible">True</property>
                    <property name="margin_start">12</property>
                    <property name="margin_end">12</property>
                    <property name="margin_top">2</property>
                    <property name="margin_bottom">2</property>
                    <property name="column_spacing">12</property>
                    <child>
                      <object class="GtkLabel" id="notification_label">
                        <property name="visible">True</property>
                        <property name="use_markup">True</property>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkButton" id="notification_action_button">
                        <property name="label" translatable="no">button</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="no_show_all">True</property>
                        <signal name="clicked" handler="undo_remove_action" object="GcalWindow" swapped="no"/>
                        <style>
                          <class name="text-button"/>
                        </style>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkButton" id="notification_close_button">
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="relief">none</property>
                        <property name="focus_on_click">False</property>
                        <signal name="clicked" handler="hide_notification" object="GcalWindow" swapped="yes"/>
                        <child>
                          <object class="GtkImage">
                            <property name="visible">True</property>
                            <property name="icon_name">window-close-symbolic</property>
                            <property name="icon_size">2</property>
                          </object>
                        </child>
                        <style>
                          <class name="image-button"/>
                        </style>
                      </object>
                      <packing>
                        <property name="left_attach">2</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                  </object>
                </child>
                <style>
                  <class name="app-notification"/>
                </style>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child type="titlebar">
      <object class="GtkHeaderBar" id="header_bar">
        <property name="visible">True</property>
        <property name="show_close_button">True</property>
        <property name="title" translatable="yes">Calendar</property>
        <child>
          <object class="GtkButton" id="today_button">
            <property name="label" translatable="yes">Today</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <property name="action_name">win.today</property>
          </object>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
        <child>
          <object class="GtkBox" id="button_box">
            <property name="visible">True</property>
            <child>
              <object class="GtkButton" id="back_button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="action_name">win.previous</property>
                <child>
                  <object class="GtkImage" id="go_back_image">
                    <property name="visible">True</property>
                    <property name="icon_name">go-previous-symbolic</property>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkButton" id="forward_button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="action_name">win.next</property>
                <child>
                  <object class="GtkImage" id="go_next_image">
                    <property name="visible">True</property>
                    <property name="icon_name">go-next-symbolic</property>
                  </object>
                </child>
              </object>
            </child>
            <style>
              <class name="linked"/>
            </style>
          </object>
        </child>
        <child type="title">
          <object class="GtkStackSwitcher" id="views_switcher">
            <property name="visible">True</property>
            <property name="stack">views_stack</property>
          </object>
        </child>
        <child>
          <object class="GtkMenuButton" id="menu_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <child>
              <object class="GtkImage" id="menu_image">
                <property name="visible">True</property>
                <property name="icon_name">open-menu-symbolic</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="pack_type">end</property>
          </packing>
        </child>
        <child>
          <object class="GtkMenuButton" id="calendars_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <property name="popover">calendar_popover</property>
            <property name="tooltip_text" translatable="yes">Manage your calendars</property>
            <child>
              <object class="GtkImage" id="calendars_button_image">
                <property name="visible">True</property>
                <property name="icon_name">x-office-calendar-symbolic</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="pack_type">end</property>
          </packing>
        </child>
        <child>
          <object class="GtkToggleButton" id="search_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <property name="tooltip_text" translatable="yes" context="tooltip">Search for events</property>
            <child>
              <object class="GtkImage" id="search_button_image">
                <property name="visible">True</property>
                <property name="icon_name">edit-find-symbolic</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="pack_type">end</property>
          </packing>
        </child>
      </object>
    </child>
  </template>
  <object class="GcalSearchView" id="search_view">
    <property name="relative_to">search_entry</property>
    <property name="position">bottom</property>
    <signal name="event-activated" handler="search_event_selected" object="GcalWindow" swapped="no"/>
  </object>
  <object class="GtkPopover" id="calendar_popover">
    <property name="border_width">6</property>
    <child>
      <object class="GtkBox" id="calendar_box">
        <property name="visible">True</property>
        <property name="orientation">vertical</property>
        <property name="spacing">6</property>
        <child>
          <object class="GtkScrolledWindow">
            <property name="visible">True</property>
            <property name="hscrollbar_policy">never</property>
            <property name="max_content_height">450</property>
            <property name="propagate-natural-height">True</property>
            <child>
              <object class="GtkListBox" id="calendar_listbox">
                <property name="visible">True</property>
                <property name="hexpand">True</property>
                <property name="selection_mode">none</property>
                <signal name="row-activated" handler="source_row_activated" object="GcalWindow" swapped="no"/>
                <style>
                  <class name="calendar-list"/>
                </style>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkButton" id="calendar_settings_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="relief">none</property>
            <property name="receives_default">True</property>
            <property name="action_name">win.show-calendars</property>
            <child>
              <object class="GtkLabel" id="calendar_settings_label">
                <property name="visible">True</property>
                <property name="label" translatable="yes">Calendar Settings</property>
                <property name="xalign">0</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
      </object>
    </child>
  </object>
  <object class="GcalQuickAddPopover" id="quick_add_popover">
    <property name="visible">False</property>
    <property name="relative_to">views_stack</property>
    <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="GcalSourceDialog" id="source_dialog">
    <property name="visible">False</property>
    <property name="transient_for">GcalWindow</property>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete" object="GcalWindow" swapped="no" />
  </object>
  <object class="GcalEditDialog" id="edit_dialog">
    <property name="visible">False</property>
    <property name="transient_for">GcalWindow</property>
    <signal name="response" handler="edit_dialog_closed" object="GcalWindow" swapped="no"/>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete" object="GcalWindow" swapped="no"/>
  </object>
</interface>
