<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.16"/>
  <template class="ChattyNewChatDialog" parent="GtkDialog">
    <property name="modal">True</property>
    <property name="can_focus">False</property>
    <property name="default_width">360</property>
    <property name="default_height">576</property>
    <property name="type_hint">dialog</property>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
    <child type="titlebar">
      <object class="HdyTitleBar">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
          <object class="GtkStack" id="header_stack">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="transition_type">slide-left-right</property>
            <property name="visible-child-name" bind-source="new_chat_stack" bind-property="visible-child-name" bind-flags="bidirectional|sync-create"/>
            <child>
              <object class="GtkHeaderBar" id="header_view_new_chat">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="show_close_button">True</property>
                <property name="title" translatable="yes">Start Chat</property>
                <child>
                  <object class="GtkButton" id="edit_contact_button">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <signal name="clicked" handler="edit_contact_button_clicked_cb" swapped="yes" />
                    <style>
                      <class name="image-button"/>
                    </style>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">contact-new-symbolic</property>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="name">view-new-chat</property>
              </packing>
            </child>
            <child>
              <object class="GtkHeaderBar">
                <property name="title" translatable="yes">New Contact</property>
                <property name="visible">True</property>
                <child>
                  <object class="GtkButton" id="back_button">
                    <property name="can_focus">False</property>
                    <property name="receives_default">False</property>
                    <property name="visible">True</property>
                    <signal name="clicked" handler="back_button_clicked_cb" swapped="yes" />
                    <style>
                      <class name="image-button"/>
                    </style>
                    <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>
                  <object class="GtkButton" id="add_contact_button">
                    <property name="has_default">True</property>
                    <property name="can_default">True</property>
                    <property name="label" translatable="yes">Add Contact</property>
                    <property name="sensitive">False</property>
                    <property name="visible">True</property>
                    <signal name="clicked" handler="add_contact_button_clicked_cb" swapped="yes" />
                    <style>
                      <class name="suggested-action"/>
                    </style>
                  </object>
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkSpinner" id="open_contact_spinner">
                    <property name="margin-end">6</property>
                    <property name="visible" bind-source="add_contact_button" bind-property="visible" bind-flags="invert-boolean"/>
                    <property name="active" bind-source="add_in_contacts_button" bind-property="sensitive" bind-flags="invert-boolean"/>
                  </object>
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="name">view-new-contact</property>
              </packing>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child internal-child="vbox">
      <object class="GtkBox">
        <property name="expand">True</property>
        <property name="visible">True</property>
        <property name="border_width">0</property>
        <child>
          <object class="GtkScrolledWindow">
            <property name="propagate_natural_height">True</property>
            <property name="hscrollbar_policy">never</property>
            <property name="expand">True</property>
            <property name="visible">True</property>
            <signal name="edge-reached" handler="contact_stroll_edge_reached_cb" swapped="yes"/>
            <child>
              <object class="GtkStack" id="new_chat_stack">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="vhomogeneous">False</property>
                <property name="transition_type">slide-left-right</property>
                <child>
                  <object class="GtkBox">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="orientation">vertical</property>
                    <property name="valign">fill</property>
                    <child>
                      <object class="HdySearchBar" id="contacts_search_bar">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">fill</property>
                        <property name="valign">start</property>
                        <property name="hexpand">True</property>
                        <property name="show-close-button">False</property>
                        <property name="search-mode-enabled">True</property>
                        <child>
                          <object class="HdyClamp">
                            <property name="visible">True</property>
                            <property name="hexpand">True</property>
                            <child>
                              <object class="GtkSearchEntry" id="contacts_search_entry">
                                <property name="visible">True</property>
                                <property name="hexpand">True</property>
                                <property name="has_focus">True</property>
                                <property name="receives_default">False</property>
                                <property name="placeholder-text" translatable="yes">Send To:</property>
                                <signal name="search-changed" handler="contact_search_entry_changed_cb" swapped="yes"/>
                              </object>
                            </child>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                      </packing>
                    </child>

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

                        <!-- Search results view -->
                        <child>
                          <object class="GtkBox" id="contact_list_view">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="hexpand">True</property>
                            <property name="orientation">vertical</property>
                            <property name="valign">start</property>

                            <child>
                              <object class="GtkListBox" id="new_contact_listbox">
                                <property name="visible" bind-source="new_contact_row" bind-property="visible"/>
                                <property name="selection-mode">none</property>
                                <signal name="row-activated" handler="contact_row_activated_cb" swapped="yes"/>
                                <child>
                                  <object class="ChattyListRow" id="new_contact_row"/>
                                </child>
                                <style>
                                 <class name="frame"/>
                                </style>
                              </object>
                            </child>

                            <child>
                              <object class="GtkListBox" id="chats_listbox">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="expand">True</property>
                                <property name="selection-mode">none</property>
                                <signal name="row-activated" handler="contact_row_activated_cb" swapped="yes"/>
                                <style>
                                 <class name="frame"/>
                                </style>
                              </object>
                            </child>

                          </object>
                        </child>

                        <!-- Empty search results view -->
                        <child>
                          <object class="GtkBox" id="empty_search_view">
                            <property name="visible">True</property>
                            <property name="valign">center</property>
                            <property name="halign">center</property>
                            <property name="hexpand">False</property>
                            <property name="margin-bottom">18</property>
                            <property name="orientation">vertical</property>
                            <property name="spacing">6</property>
                            <child>
                              <object class="GtkImage">
                                <property name="visible">True</property>
                                <property name="icon-name">system-search-symbolic</property>
                                <property name="pixel-size">64</property>
                              </object>
                            </child>
                            <child>
                              <object class="GtkLabel">
                                <property name="visible">True</property>
                                <property name="label" translatable="yes">No Search Results</property>
                                <attributes>
                                  <attribute name="weight" value="bold"/>
                                  <attribute name="scale" value="1.2"/>
                                </attributes>
                              </object>
                            </child>
                            <child>
                              <object class="GtkLabel">
                                <property name="visible">True</property>
                                <property name="wrap">True</property>
                                <property name="max-width-chars">24</property>
                                <property name="justify">center</property>
                                <property name="label" translatable="yes">Try different search, or type a valid number to create new chat</property>
                                <style>
                                 <class name="dim-label"/>
                                </style>
                              </object>
                            </child>
                          </object>
                        </child>

                      </object>
                    </child>

                  </object>
                  <packing>
                    <property name="name">view-new-chat</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkBox">
                    <property name="orientation">vertical</property>
                    <property name="visible">True</property>
                    <child>
                      <object class="HdyClamp">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">fill</property>
                        <property name="valign">fill</property>
                        <property name="margin-bottom">32</property>
                        <property name="margin-start">12</property>
                        <property name="margin-end">12</property>
                        <property name="margin-top">32</property>
                        <property name="expand">True</property>
                        <child>
                          <object class="GtkBox">
                            <property name="visible">True</property>
                            <property name="orientation">vertical</property>
                            <property name="can_focus">False</property>
                            <property name="valign">start</property>
                            <property name="expand">True</property>
                            <child>
                              <object class="GtkImage">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="valign">center</property>
                                <property name="pixel_size">72</property>
                                <property name="icon_name">avatar-default-symbolic</property>
                                <property name="icon-size">0</property>
                                <property name="margin-bottom">32</property>
                              </object>
                              <packing>
                                <property name="expand">False</property>
                                <property name="fill">True</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="expand">True</property>
                                <property name="label" translatable="yes">Select chat account</property>
                                <property name="justify">left</property>
                                <property name="halign">start</property>
                                <property name="margin-bottom">12</property>
                                <attributes>
                                  <attribute name="weight" value="bold"/>
                                </attributes>
                              </object>
                            </child>
                            <child>
                              <object class="GtkListBox" id="accounts_list">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="expand">True</property>
                                <property name="selection-mode">none</property>
                                <property name="margin-bottom">32</property>
                                <signal name="row-activated" handler="account_list_row_activated_cb" swapped="yes"/>
                                <style>
                                  <class name="content"/>
                                </style>
                              </object>
                            </child>
                            <child>
                              <object class="GtkGrid" id="contact_edit_grid">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="halign">center</property>
                                <property name="margin_top">24</property>
                                <property name="row_spacing">12</property>
                                <property name="column_spacing">6</property>
                                <child>
                                  <object class="GtkLabel" id="label_contact_id">
                                    <property name="visible">True</property>
                                    <property name="xalign">1</property>
                                    <property name="can_focus">False</property>
                                    <property name="label" translatable="no">Contact ID</property>
                                  </object>
                                  <packing>
                                    <property name="left_attach">0</property>
                                    <property name="top_attach">0</property>
                                  </packing>
                                </child>
                                <child>
                                  <object class="GtkLabel" id="label_alias">
                                    <property name="visible">True</property>
                                    <property name="xalign">1</property>
                                    <property name="can_focus">False</property>
                                    <property name="label" translatable="yes">Name (optional)</property>
                                  </object>
                                  <packing>
                                    <property name="left_attach">0</property>
                                    <property name="top_attach">1</property>
                                  </packing>
                                </child>
                                <child>
                                  <object class="GtkEntry" id="contact_name_entry">
                                    <property name="visible">True</property>
                                    <property name="can_focus">True</property>
                                    <signal name="changed" handler="contact_name_text_changed_cb" after="yes" swapped="yes" />
                                    <signal name="activate" handler="add_contact_button_clicked_cb" swapped="yes"/>
                                  </object>
                                  <packing>
                                    <property name="left_attach">1</property>
                                    <property name="top_attach">0</property>
                                  </packing>
                                </child>
                                <child>
                                  <object class="GtkEntry" id="contact_alias_entry">
                                    <property name="visible">True</property>
                                    <property name="can_focus">True</property>
                                    <signal name="activate" handler="add_contact_button_clicked_cb" swapped="yes"/>
                                  </object>
                                  <packing>
                                    <property name="left_attach">1</property>
                                    <property name="top_attach">1</property>
                                  </packing>
                                </child>
                              </object>
                              <packing>
                                <property name="expand">False</property>
                                <property name="fill">True</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkButton" id="add_in_contacts_button">
                                <property name="has_default">True</property>
                                <property name="can_default">True</property>
                                <property name="label" translatable="yes">Add to Contacts</property>
                                <property name="visible">True</property>
                                <signal name="clicked" handler="add_in_contacts_button_clicked_cb" swapped="yes" />
                                <style>
                                  <class name="suggested-action"/>
                                </style>
                              </object>
                              <packing>
                                <property name="pack_type">end</property>
                              </packing>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="name">view-new-contact</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
          <packing>
            <property name="expand">True</property>
            <property name="fill">True</property>
          </packing>
        </child>
      </object>
    </child>
  </template>
</interface>
