<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.16"/>
  <object class="GtkPopoverMenu" id="header_view_chat_list_popover">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkBox">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="margin">12</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkModelButton">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">Preferences</property>
            <signal name="clicked" handler="chatty_window_show_settings_dialog" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkModelButton">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">About Chats</property>
            <signal name="clicked" handler="chatty_window_show_about_dialog" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="submenu">main</property>
      </packing>
    </child>
  </object>
  <object class="GtkPopoverMenu" id="header_chat_list_new_msg_popover">
    <property name="can_focus">False</property>
    <property name="relative-to">header_add_chat_button</property>
    <child>
      <object class="GtkBox">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="margin">12</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkModelButton" id="menu_new_message_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">New Message…</property>
            <signal name="clicked" handler="window_new_message_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkModelButton" id="menu_new_group_message_button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">New Group Message…</property>
            <signal name="clicked" handler="window_new_muc_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="submenu">main</property>
      </packing>
    </child>
  </object>
  <object class="GtkPopoverMenu" id="header_view_message_list_popover">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkBox">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="margin">12</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkModelButton">
            <property name="visible">True</property>
            <property name="active">False</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">Chat Details</property>
            <signal name="clicked" handler="window_show_chat_info_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkModelButton" id="menu_add_contact_button">
            <property name="visible">False</property>
            <property name="active">False</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">Add Contact</property>
            <signal name="clicked" handler="window_add_contact_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkSeparator" id="separator_menu_msg_view2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="margin_top">6</property>
            <property name="margin_bottom">6</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkModelButton" id="leave_button">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">Leave Chat</property>
            <signal name="clicked" handler="window_leave_chat_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
        <child>
          <object class="GtkModelButton" id="delete_button">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="receives_default">False</property>
            <property name="text" translatable="yes">Delete Chat</property>
            <signal name="clicked" handler="window_delete_buddy_clicked_cb" swapped="yes"/>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="submenu">main</property>
      </packing>
    </child>
  </object>
  <template class="ChattyWindow" parent="GtkApplicationWindow">
    <property name="can_focus">False</property>
    <property name="default_width">360</property>
    <property name="default_height">576</property>
    <child type="titlebar">
      <object class="HdyTitleBar">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
          <object class="HdyLeaflet" id="header_box">
            <property name="visible">True</property>
            <property name="visible-child-name" bind-source="content_box" bind-property="visible-child-name" bind-flags="sync-create"/>
            <signal name="notify::folded" handler="notify_fold_cb" after="yes" swapped="yes"/>
            <child>
              <object class="GtkHeaderBar" id="header_bar">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="show_close_button">True</property>
                <property name="title" translatable="yes">Chats</property>
                <child>
                  <object class="GtkButton" id="header_add_chat_button">
                    <property name="visible">True</property>
                    <property name="sensitive">False</property>
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <signal name="clicked" handler="window_add_chat_button_clicked_cb" swapped="yes"/>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">list-add-symbolic</property>
                      </object>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="GtkMenuButton">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <property name="popover">header_view_chat_list_popover</property>
                    <accelerator key="F10" signal="clicked" />
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">open-menu-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">False</property>
                    <property name="receives_default">False</property>
                    <property name="active" bind-source="chats_search_bar" bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
                    <accelerator key="f" modifiers="primary" signal="clicked" />
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">system-search-symbolic</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="name">sidebar</property>
              </packing>
            </child>
            <child>
              <object class="GtkSeparator">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="orientation">vertical</property>
                <style>
                  <class name="sidebar"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkHeaderBar" id="sub_header_bar">
                <property name="visible">True</property>
                <property name="expand">True</property>
                <property name="show_close_button">True</property>
                <child>
                  <object class="GtkButton">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <property name="visible" bind-source="header_box" bind-property="folded" bind-flags="sync-create"/>
                    <signal name="clicked" handler="window_back_clicked_cb" swapped="yes"/>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">go-previous-symbolic</property>
                        <property name="icon_size">1</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="pack_type">start</property>
                  </packing>
                </child>
                <child type="title">
                  <object class="GtkBox">
                    <property name="visible">True</property>
                    <property name="orientation">horizontal</property>
                    <property name="can_focus">False</property>
                    <property name="halign">center</property>
                    <property name="valign">center</property>
                    <child>
                      <object class="ChattyAvatar" id="sub_header_icon">
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="size">28</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkLabel" id="sub_header_label">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="margin-start">6</property>
                        <property name="halign">center</property>
                        <property name="ellipsize">end</property>
                        <attributes>
                          <attribute name="weight" value="bold"/>
                        </attributes>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                      </packing>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="GtkMenuButton" id="header_sub_menu_button">
                    <property name="visible">True</property>
                    <property name="sensitive">False</property>
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <property name="popover">header_view_message_list_popover</property>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">view-more-symbolic</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="position">0</property>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkButton" id="call_button">
                    <property name="visible">False</property>
                    <property name="can-focus">False</property>
                    <property name="receives-default">False</property>
                    <signal name="clicked" handler="window_call_button_clicked_cb" swapped="yes"/>
                    <child internal-child="accessible">
                      <object class="AtkObject">
                        <property name="accessible-name" translatable="yes">Call</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="icon-name">call-start-symbolic</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="position">1</property>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="name">content</property>
              </packing>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="HdyLeaflet" id="content_box">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="transition-type">slide</property>
        <child>
          <object class="GtkBox" id="sidebar">
            <property name="visible">True</property>
            <property name="orientation">vertical</property>

            <!-- Search bar -->
            <child>
              <object class="HdySearchBar" id="chats_search_bar">
                <property name="visible">True</property>
                <property name="hexpand">False</property>
                <child>
                  <object class="GtkSearchEntry" id="chats_search_entry">
                    <property name="visible">True</property>
                    <signal name="search-changed" handler="window_search_changed_cb" swapped="yes"/>
                  </object>
                </child>
              </object>
            </child>

            <child>
              <object class="GtkScrolledWindow">
                <property name="hscrollbar_policy">never</property>
                <property name="width_request">300</property>
                <property name="visible">True</property>
                <property name="hexpand">False</property>

                <child>
                  <object class="GtkStack" id="sidebar_stack">
                    <property name="visible">True</property>

                    <!-- Empty chat list view -->
                    <child>
                      <object class="HdyStatusPage" id="empty_view">
                        <property name="visible">True</property>
                        <property name="expand">True</property>
                        <property name="title" translatable="yes">Start Chatting</property>
                        <property name="icon-name">sm.puri.Chatty-symbolic</property>
                      </object>
                    </child>

                    <!-- Chat list view -->
                    <child>
                      <object class="GtkBox" id="chat_list_view">
                        <property name="visible">True</property>
                        <property name="orientation">vertical</property>
                        <property name="expand">True</property>

                        <!-- Chat list -->
                        <child>
                          <object class="GtkListBox" id="chats_listbox">
                            <property name="visible">True</property>
                            <property name="vexpand">True</property>
                            <property name="selection-mode">none</property>
                            <signal name="row-activated" handler="window_chat_row_activated_cb" swapped="no"/>
                          </object>
                        </child>

                      </object>
                    </child>

                  </object>
                </child>
              </object>
            </child>
          </object>
          <packing>
            <property name="name">sidebar</property>
          </packing>
        </child>
        <child>
          <object class="GtkSeparator">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="orientation">vertical</property>
            <style>
              <class name="sidebar"/>
            </style>
          </object>
        </child>
        <child>
          <object class="ChattyChatView" id="chat_view">
            <property name="visible">True</property>
            <property name="width_request">300</property>
          </object>
          <packing>
            <property name="name">content</property>
          </packing>
        </child>
      </object>
    </child>
  </template>
  <object class="GtkSizeGroup" id="start_pane_size_group">
    <property name="mode">horizontal</property>
    <widgets>
      <widget name="header_bar"/>
      <widget name="sidebar"/>
    </widgets>
  </object>
  <object class="GtkSizeGroup" id="end_pane_size_group">
    <property name="mode">horizontal</property>
    <widgets>
      <widget name="sub_header_bar"/>
      <widget name="chat_view"/>
    </widgets>
  </object>
  <object class="HdyHeaderGroup" id="header_group">
    <property name="decorate-all" bind-source="content_box" bind-property="folded" bind-flags="sync-create"/>
    <headerbars>
      <headerbar name="header_bar"/>
      <headerbar name="sub_header_bar"/>
    </headerbars>
  </object>
</interface>
