<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <menu id="room-menu-model">
    <section>
      <item>
        <attribute name="label" translatable="yes">Room _Details</attribute>
        <attribute name="action">room-history.details</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Invite New Member</attribute>
        <attribute name="action">room-history.invite-members</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">Room _Permalink</attribute>
        <attribute name="action">room-history.permalink</attribute>
      </item>
    </section>
    <section>
      <item>
        <attribute name="label" translatable="yes">_Leave Room</attribute>
        <attribute name="action">room-history.leave</attribute>
        <attribute name="hidden-when">action-disabled</attribute>
      </item>
    </section>
  </menu>
  <menu id="message-menu-model">
    <section>
      <item>
        <attribute name="label" translatable="yes">_Location</attribute>
        <attribute name="action">room-history.send-location</attribute>
        <attribute name="icon">map-marker-symbolic</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Markdown</attribute>
        <attribute name="action">room-history.markdown</attribute>
      </item>
    </section>
  </menu>
  <template class="ContentRoomHistory" parent="AdwBin">
    <property name="vexpand">True</property>
    <property name="hexpand">True</property>
    <child>
      <object class="GtkBox">
        <property name="orientation">vertical</property>
        <child>
          <object class="AdwHeaderBar" id="headerbar">
            <property name="show-start-title-buttons" bind-source="ContentRoomHistory" bind-property="compact" bind-flags="sync-create"/>
            <child type="start">
              <object class="GtkRevealer">
                <property name="transition-type">crossfade</property>
                <property name="reveal-child" bind-source="ContentRoomHistory" bind-property="compact" bind-flags="sync-create"/>
                <property name="child">
                  <object class="GtkButton" id="back">
                    <property name="icon-name">go-previous-symbolic</property>
                    <property name="action-name">content.go-back</property>
                    <accessibility>
                      <property name="label" translatable="yes">Back</property>
                    </accessibility>
                  </object>
                </property>
              </object>
            </child>
            <child type="title">
              <object class="RoomTitle" id="room_title">
                <binding name="title">
                  <lookup name="display-name">
                    <lookup name="room">ContentRoomHistory</lookup>
                  </lookup>
                </binding>
                <binding name="subtitle">
                  <lookup name="topic">
                    <lookup name="room">ContentRoomHistory</lookup>
                  </lookup>
                </binding>
              </object>
            </child>
            <child type="end">
              <object class="GtkMenuButton" id="room_menu">
                <property name="icon-name">view-more-symbolic</property>
                <property name="menu-model">room-menu-model</property>
                <accessibility>
                  <property name="label" translatable="yes">Room Settings</property>
                </accessibility>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="ContentVerificationInfoBar" id="verification_info_bar">
            <binding name="request">
              <lookup name="verification">
                <lookup name="room">ContentRoomHistory</lookup>
              </lookup>
            </binding>
          </object>
        </child>
        <child>
          <object class="GtkStack" id="stack">
            <property name="transition-type">crossfade</property>
            <child>
              <object class="GtkSpinner" id="loading">
                <property name="spinning">True</property>
                <property name="valign">center</property>
                <property name="halign">center</property>
                <property name="vexpand">True</property>
                <style>
                  <class name="session-loading-spinner"/>
                </style>
              </object>
            </child>
            <child>
              <object class="AdwStatusPage" id="error">
                <property name="visible">True</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <property name="icon-name">dialog-error-symbolic</property>
                <property name="title" translatable="yes">Unable to load room</property>
                <property name="description" translatable="yes">Check your network connection.</property>
                <property name="child">
                  <object class="GtkButton">
                    <property name="label" translatable="yes">Try Again</property>
                    <property name="action-name">room-history.try-again</property>
                    <property name="halign">center</property>
                    <style>
                      <class name="pill"/>
                    </style>
                  </object>
                </property>
              </object>
            </child>
            <child>
              <object class="GtkOverlay" id="content">
                <child type="overlay">
                  <object class="GtkRevealer" id="scroll_btn_revealer">
                    <property name="transition_type">crossfade</property>
                    <property name="reveal_child" bind-source="ContentRoomHistory" bind-property="sticky" bind-flags="sync-create | invert-boolean"/>
                    <property name="valign">end</property>
                    <property name="halign">end</property>
                    <property name="margin-end">24</property>
                    <property name="margin-bottom">24</property>
                    <child>
                      <object class="GtkButton" id="scroll_btn">
                        <property name="icon-name">go-bottom-symbolic</property>
                        <property name="action-name">room-history.scroll-down</property>
                        <accessibility>
                          <property name="label" translatable="yes">Scroll to bottom</property>
                        </accessibility>
                        <style>
                          <class name="osd"/>
                          <class name="circular"/>
                        </style>
                      </object>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="DragOverlay" id="drag_overlay">
                    <property name="title" translatable="yes">Drop Here to Send</property>
                    <property name="child">
                      <object class="GtkScrolledWindow" id="scrolled_window">
                        <property name="vexpand">True</property>
                        <property name="hscrollbar-policy">never</property>
                        <style>
                          <class name="room-history"/>
                        </style>
                        <property name="child">
                          <object class="AdwClampScrollable">
                            <property name="vexpand">True</property>
                            <property name="hexpand">True</property>
                            <property name="maximum-size">750</property>
                            <property name="tightening-threshold">550</property>
                            <property name="child">
                              <object class="GtkListView" id="listview">
                                <style>
                                  <class name="navigation-sidebar"/>
                                </style>
                                <accessibility>
                                  <property name="label" translatable="yes">Room History</property>
                                </accessibility>
                              </object>
                            </property>
                          </object>
                        </property>
                      </object>
                    </property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkSeparator"/>
        </child>
        <child>
          <object class="AdwClamp">
            <property name="vexpand">False</property>
            <property name="maximum-size">750</property>
            <property name="tightening-threshold">550</property>
            <child>
              <object class="GtkBox">
                <property name="orientation">vertical</property>
                <child>
                  <object class="GtkBox" id="related_event_toolbar">
                    <style>
                      <class name="related-event-toolbar"/>
                    </style>
                    <property name="spacing">12</property>
                    <binding name="visible">
                      <closure type="gboolean" function="object_is_some">
                        <lookup name="related-event">ContentRoomHistory</lookup>
                      </closure>
                    </binding>
                    <child>
                      <object class="GtkBox">
                        <property name="margin-bottom">6</property>
                        <property name="margin-top">8</property>
                        <property name="orientation">vertical</property>
                        <child>
                          <object class="LabelWithWidgets" id="related_event_header">
                            <style>
                              <class name="heading"/>
                            </style>
                            <property name="valign">center</property>
                            <property name="hexpand">true</property>
                            <property name="margin-top">2</property>
                          </object>
                        </child>
                        <child>
                          <object class="ContentMessageContent" id="related_event_content">
                            <style>
                              <class name="related-event-content"/>
                              <class name="dim-label"/>
                            </style>
                            <property name="format">ellipsized</property>
                          </object>
                        </child>
                        <child>
                          <object class="GtkGestureClick">
                            <signal name="pressed" handler="handle_related_event_click" swapped="yes"/>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton">
                        <style>
                          <class name="circular"/>
                        </style>
                        <property name="halign">end</property>
                        <property name="valign">start</property>
                        <property name="icon-name">window-close-symbolic</property>
                        <property name="action-name">room-history.clear-related-event</property>
                      </object>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="GtkBox">
                    <style>
                      <class name="toolbar"/>
                    </style>
                    <child>
                      <object class="GtkButton">
                        <property name="valign">end</property>
                        <property name="icon-name">mail-attachment-symbolic</property>
                        <property name="action-name">room-history.select-file</property>
                        <accessibility>
                          <property name="label" translatable="yes">Browse Attachment</property>
                        </accessibility>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton">
                        <property name="valign">end</property>
                        <property name="icon-name">emoji-people-symbolic</property>
                        <property name="action-name">room-history.open-emoji</property>
                        <accessibility>
                          <property name="label" translatable="yes">Open Emoji Picker</property>
                        </accessibility>
                      </object>
                    </child>
                    <child>
                      <object class="CustomEntry">
                        <child>
                          <object class="GtkScrolledWindow">
                            <property name="vexpand">True</property>
                            <property name="hexpand">True</property>
                            <property name="vscrollbar-policy">external</property>
                            <property name="max-content-height">200</property>
                            <property name="propagate-natural-height">True</property>
                            <property name="child">
                              <object class="GtkSourceView" id="message_entry">
                                <property name="hexpand">True</property>
                                <property name="accepts-tab">False</property>
                                <property name="top-margin">7</property>
                                <property name="bottom-margin">7</property>
                                <property name="wrap-mode">word</property>
                                <accessibility>
                                  <property name="label" translatable="yes">Message Entry</property>
                                </accessibility>
                              </object>
                            </property>
                          </object>
                        </child>
                      </object>
                    </child>
                    <child>
                      <object class="GtkMenuButton">
                        <property name="valign">end</property>
                        <property name="direction">up</property>
                        <property name="icon-name">view-more-horizontal-symbolic</property>
                        <property name="menu-model">message-menu-model</property>
                        <accessibility>
                          <property name="label" translatable="yes">Open Message Menu</property>
                        </accessibility>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton">
                        <property name="valign">end</property>
                        <property name="icon-name">send-symbolic</property>
                        <property name="focus-on-click">False</property>
                        <property name="action-name">room-history.send-text-message</property>
                        <style>
                          <class name="suggested-action"/>
                          <class name="circular"/>
                        </style>
                        <accessibility>
                          <property name="label" translatable="yes">Send Message</property>
                        </accessibility>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>
