<?xml version="1.0" encoding="UTF-8"?>
<interface domain="libadwaita">
  <requires lib="gtk" version="4.0"/>
  <template class="AdwPreferencesWindow" parent="AdwWindow">
    <property name="modal">True</property>
    <property name="destroy_with_parent">True</property>
    <property name="icon_name">gtk-preferences</property>
    <property name="title" translatable="yes">Preferences</property>
    <property name="default-width">640</property>
    <property name="default-height">576</property>
    <style>
      <class name="preferences"/>
    </style>
    <child>
      <object class="AdwToastOverlay" id="toast_overlay">
        <child>
          <object class="AdwLeaflet" id="subpages_leaflet">
            <property name="can-navigate-back" bind-source="AdwPreferencesWindow" bind-property="can-navigate-back" bind-flags="sync-create"/>
            <property name="can-unfold">False</property>
            <property name="width-request">360</property>
            <signal name="notify::child-transition-running" handler="subpages_leaflet_child_transition_running_cb" swapped="yes"/>
            <signal name="notify::visible-child" handler="subpages_leaflet_visible_child_cb" swapped="yes"/>
            <child>
              <object class="GtkBox" id="preferences">
                <property name="orientation">vertical</property>
                <child>
                  <object class="AdwHeaderBar">
                    <property name="centering-policy">strict</property>
                    <property name="title-widget">
                      <object class="GtkStack" id="title_stack">
                        <property name="transition-type">crossfade</property>
                        <property name="hexpand">True</property>
                        <signal name="notify::visible-child" handler="title_stack_notify_visible_child_cb" swapped="true"/>
                        <signal name="notify::transition-running" handler="title_stack_notify_transition_running_cb" swapped="true"/>
                        <child>
                          <object class="GtkStackPage">
                            <property name="name">pages</property>
                            <property name="child">
                              <object class="AdwViewSwitcherTitle" id="view_switcher_title">
                                <property name="stack">pages_stack</property>
                                <property name="title" bind-source="AdwPreferencesWindow" bind-property="title" bind-flags="sync-create"/>
                              </object>
                            </property>
                          </object>
                        </child>
                        <child>
                          <object class="GtkStackPage">
                            <property name="name">search</property>
                            <property name="child">
                              <object class="AdwClamp">
                                <property name="tightening-threshold">300</property>
                                <property name="maximum-size">400</property>
                                <child>
                                  <object class="GtkSearchEntry" id="search_entry">
                                    <signal name="search-started" handler="search_started_cb" swapped="yes"/>
                                    <signal name="search-changed" handler="search_changed_cb" swapped="yes"/>
                                    <signal name="stop-search" handler="stop_search_cb" swapped="yes"/>
                                  </object>
                                </child>
                              </object>
                            </property>
                          </object>
                        </child>
                      </object>
                    </property>
                    <child type="end">
                      <object class="GtkToggleButton" id="search_button">
                        <property name="valign">center</property>
                        <property name="tooltip-text" translatable="yes">Search</property>
                        <property name="icon_name">edit-find-symbolic</property>
                        <signal name="notify::active" handler="search_button_notify_active_cb" swapped="yes"/>
                      </object>
                    </child>
                  </object>
                </child>
                <child>
                  <object class="GtkStack" id="content_stack">
                    <property name="transition-type">crossfade</property>
                    <property name="vhomogeneous">False</property>
                    <child>
                      <object class="GtkStackPage">
                        <property name="name">pages</property>
                        <property name="child">
                          <object class="GtkBox">
                            <property name="orientation">vertical</property>
                            <child>
                              <object class="AdwViewStack" id="pages_stack">
                                <property name="vexpand">True</property>
                                <signal name="notify::visible-child" handler="notify_visible_page_cb" swapped="yes"/>
                                <signal name="notify::visible-child-name" handler="notify_visible_page_name_cb" swapped="yes"/>
                              </object>
                            </child>
                            <child>
                              <object class="AdwViewSwitcherBar" id="view_switcher_bar">
                                <property name="stack">pages_stack</property>
                                <property name="reveal" bind-source="view_switcher_title" bind-property="title-visible" bind-flags="sync-create"/>
                              </object>
                            </child>
                          </object>
                        </property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkStackPage">
                        <property name="name">search</property>
                        <property name="child">
                          <object class="GtkStack" id="search_stack">
                            <child>
                              <object class="GtkStackPage">
                                <property name="name">results</property>
                                <property name="child">
                                  <object class="AdwPreferencesPage">
                                    <child>
                                      <object class="AdwPreferencesGroup">
                                        <child>
                                          <object class="GtkListBox" id="search_results">
                                            <property name="selection-mode">none</property>
                                            <property name="valign">start</property>
                                            <signal name="row-activated" handler="search_result_activated_cb" swapped="yes"/>
                                            <signal name="map" handler="search_results_map" swapped="yes"/>
                                            <signal name="unmap" handler="search_results_unmap" swapped="yes"/>
                                            <style>
                                              <class name="boxed-list"/>
                                            </style>
                                          </object>
                                        </child>
                                      </object>
                                    </child>
                                  </object>
                                </property>
                              </object>
                            </child>
                            <child>
                              <object class="GtkStackPage">
                                <property name="name">no-results</property>
                                <property name="child">
                                  <object class="AdwStatusPage">
                                    <property name="icon-name">edit-find-symbolic</property>
                                    <property name="title" translatable="yes">No Results Found</property>
                                    <property name="description" translatable="yes">Try a different search.</property>
                                  </object>
                                </property>
                              </object>
                            </child>
                          </object>
                        </property>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>
