<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <template class="ChattyPpChatInfo" parent="HdyPreferencesPage">
    <property name="visible">1</property>

    <child>
      <object class="HdyPreferencesGroup">
        <property name="visible">1</property>

        <!-- Room name -->
        <child>
          <object class="GtkLabel" id="room_name">
            <property name="visible" bind-source="avatar_button" bind-property="visible"
                      bind-flags="invert-boolean|bidirectional|sync-create"/>
            <attributes>
              <attribute name="scale" value="2"/>
            </attributes>
          </object>
        </child>

        <child>
          <object class="GtkButton" id="avatar_button">
            <property name="visible" bind-source="avatar" bind-property="visible"
                      bind-flags="sync-create"/>
            <property name="hexpand">1</property>
            <property name="halign">center</property>
            <property name="can-focus">0</property>
            <property name="focus-on-click">0</property>
            <property name="receives_default">0</property>
            <property name="margin-bottom">24</property>
            <signal name="clicked" handler="pp_info_avatar_button_clicked_cb" swapped="yes"/>
            <child>
              <object class="ChattyAvatar" id="avatar">
                <property name="visible">1</property>
                <property name="size">96</property>
              </object>
            </child>
          </object>
        </child>

      </object>
    </child>

    <child>
      <object class="HdyPreferencesGroup">
        <property name="visible" bind-source="room_topic_view" bind-property="visible"
                  bind-flags="sync-create"/>
        <child>
          <object class="GtkBox">
            <property name="visible">1</property>
            <property name="spacing">6</property>
            <property name="orientation">vertical</property>

            <child>
              <object class="GtkLabel">
                <property name="visible" bind-source="room_topic_view" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="halign">start</property>
                <property name="label" translatable="yes">Room topic</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>

            <child>
              <object class="GtkBox">
                <property name="visible" bind-source="room_topic_view" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="spacing">6</property>

                <!-- Topic text view -->
                <child>
                  <object class="GtkFrame">
                    <property name="visible">1</property>
                    <child>
                      <object class="GtkTextView" id="room_topic_view">
                        <property name="visible">1</property>
                        <property name="hexpand">1</property>
                        <property name="cursor-visible">0</property>
                        <property name="left-margin">6</property>
                        <property name="right-margin">6</property>
                        <property name="top-margin">6</property>
                        <property name="bottom-margin">6</property>
                        <property name="wrap-mode">word-char</property>
                        <property name="buffer">topic_buffer</property>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Topic edit button -->
                <child>
                  <object class="GtkToggleButton" id="edit_topic_button">
                    <property name="visible">1</property>
                    <property name="can-focus">0</property>
                    <property name="valign">start</property>
                    <signal name="clicked" handler="pp_chat_info_edit_topic_clicked_cb" swapped="yes"/>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">1</property>
                        <property name="icon-name">document-edit-symbolic</property>
                      </object>
                    </child>
                  </object>
                </child>

              </object>
            </child>

          </object>
        </child>
      </object> <!-- ./HdyPreferencesGroup -->
    </child>

    <child>
      <object class="HdyPreferencesGroup">
        <property name="visible">1</property>
        <child>
          <object class="GtkGrid">
            <property name="visible">1</property>
            <property name="hexpand">1</property>
            <property name="valign">start</property>
            <property name="margin-bottom">24</property>
            <property name="row-spacing">6</property>
            <property name="column-spacing">6</property>
            <property name="orientation">vertical</property>

            <!-- User Alias -->
            <child>
              <object class="GtkLabel">
                <property name="visible" bind-source="name_label" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="xalign">1</property>
                <property name="label" translatable="no">User</property>
                <style>
                  <class name="dim-label"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="name_label">
                <property name="visible">1</property>
                <property name="expand">1</property>
                <property name="halign">start</property>
                <property name="ellipsize">end</property>
                <property name="justify">left</property>
                <property name="selectable">1</property>
              </object>
              <packing>
                <property name="left-attach">1</property>
                <property name="top-attach">0</property>
              </packing>
            </child>

            <!-- User ID -->
            <child>
              <object class="GtkLabel" id="user_id_title">
                <property name="visible" bind-source="user_id_label" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">XMPP ID</property>
                <style>
                  <class name="dim-label"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="user_id_label">
                <property name="visible">1</property>
                <property name="expand">1</property>
                <property name="halign">start</property>
                <property name="ellipsize">end</property>
                <property name="justify">left</property>
                <property name="selectable">1</property>
              </object>
              <packing>
                <property name="left-attach">1</property>
                <property name="top-attach">1</property>
              </packing>
            </child>

            <!-- Encryption status -->
            <child>
              <object class="GtkLabel">
                <property name="visible" bind-source="encryption_label" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">Encryption</property>
                <style>
                  <class name="dim-label"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="encryption_label">
                <property name="visible">0</property>
                <property name="expand">1</property>
                <property name="halign">start</property>
                <property name="ellipsize">end</property>
                <property name="justify">left</property>
              </object>
              <packing>
                <property name="left-attach">1</property>
                <property name="top-attach">2</property>
              </packing>
            </child>

            <!-- Online status -->
            <child>
              <object class="GtkLabel">
                <property name="visible" bind-source="status_label" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="xalign">1</property>
                <property name="label" translatable="yes">Status</property>
                <style>
                  <class name="dim-label"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="status_label">
                <property name="visible">0</property>
                <property name="expand">1</property>
                <property name="halign">start</property>
                <property name="ellipsize">end</property>
                <property name="justify">left</property>
              </object>
              <packing>
                <property name="left-attach">1</property>
                <property name="top-attach">3</property>
              </packing>
            </child>

            <child>
              <object class="GtkLabel" id="settings_label">
                <property name="visible">1</property>
                <property name="halign">start</property>
                <property name="margin-top">12</property>
                <property name="label" translatable="yes">Chat settings</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>

            <child>
              <object class="GtkListBox">
                <property name="visible">1</property>
                <property name="expand">1</property>
                <property name="selection-mode">none</property>
                <style>
                  <class name="content"/>
                </style>

                <!-- Notifications row -->
                <child>
                  <object class="HdyActionRow">
                    <property name="visible" bind-source="notification_switch" bind-property="visible"
                              bind-flags="sync-create"/>
                    <property name="title" translatable="yes">Notifications</property>
                    <property name="activatable-widget">notification_switch</property>
                    <child>
                      <object class="GtkSwitch" id="notification_switch">
                        <property name="visible">1</property>
                        <property name="valign">center</property>
                        <signal name="notify::active" handler="pp_chat_info_notification_switch_changed_cb" swapped="yes"/>
                      </object>
                    </child>
                  </object>
                </child>

                <!-- Status messages row -->
                <child>
                  <object class="HdyActionRow">
                    <property name="visible" bind-source="show_status_switch" bind-property="visible"
                              bind-flags="sync-create"/>
                    <property name="title" translatable="yes">Status Messages</property>
                    <property name="subtitle" translatable="yes">Show status messages in chat</property>
                    <property name="activatable-widget">show_status_switch</property>
                    <child>
                      <object class="GtkSwitch" id="show_status_switch">
                        <property name="visible">1</property>
                        <property name="valign">center</property>
                        <signal name="notify::active" handler="pp_chat_info_show_status_switch_changed_cb" swapped="yes"/>
                      </object>
                    </child>
                  </object>
                </child>

                <child>
                  <object class="HdyActionRow">
                    <property name="visible" bind-source="encryption_switch" bind-property="visible"
                              bind-flags="sync-create"/>
                    <property name="title" translatable="yes">Encryption</property>
                    <property name="subtitle" translatable="yes">Encrypt Messages</property>
                    <property name="activatable-widget">encryption_switch</property>
                    <child>
                      <object class="GtkSwitch" id="encryption_switch">
                        <property name="visible">1</property>
                        <property name="valign">center</property>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
              <packing>
                <property name="width">2</property>
              </packing>
            </child>

            <child>
              <object class="GtkLabel">
                <property name="visible" bind-source="key_list" bind-property="visible"
                          bind-flags="sync-create"/>
                <property name="halign">start</property>
                <property name="margin-top">12</property>
                <property name="label" translatable="yes">Fingerprints</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>

            <!-- Fingerprints/Device keys -->
            <child>
              <object class="GtkListBox" id="key_list">
                <property name="can-focus">0</property>
                <property name="expand">1</property>
                <property name="selection-mode">none</property>
                <style>
                  <class name="content"/>
                </style>
              </object>
              <packing>
                <property name="width">2</property>
              </packing>
            </child>

            <child>
              <object class="GtkLabel" id="user_list_label">
                <property name="visible" bind-source="user_list" bind-property="visible"
                          bind-flags="bidirectional|sync-create"/>
                <property name="halign">start</property>
                <property name="margin-top">12</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>

            <!-- User List -->
            <child>
              <object class="GtkListBox" id="user_list">
                <property name="can-focus">0</property>
                <property name="expand">1</property>
                <style>
                  <class name="content"/>
                </style>
              </object>
              <packing>
                <property name="width">2</property>
              </packing>
            </child>

          </object>
        </child>
      </object> <!-- ./HdyPreferencesGroup -->
    </child>

  </template>
  <object class="GtkFileChooserDialog" id="avatar_chooser_dialog">
    <property name="modal">1</property>
    <property name="filter">image_filter</property>
    <property name="title" translatable="yes">Set Avatar</property>
    <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
    <child type="action">
      <object class="GtkButton" id="avatar_cancel_button">
        <property name="visible">1</property>
        <property name="label" translatable="yes">Cancel</property>
      </object>
    </child>
    <child type="action">
      <object class="GtkButton" id="avatar_apply_button">
        <property name="visible">1</property>
        <property name="can-default">1</property>
        <property name="label" translatable="yes">Open</property>
      </object>
    </child>
    <action-widgets>
      <action-widget response="cancel">avatar_cancel_button</action-widget>
      <action-widget response="apply" default="true">avatar_apply_button</action-widget>
    </action-widgets>
  </object>

  <object class="GtkFileFilter" id="image_filter">
    <mime-types>
      <mime-type>image/*</mime-type>
    </mime-types>
  </object>

  <object class="GtkTextBuffer" id="topic_buffer"/>

</interface>
