<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk" version="4.0"/>
  <template class="MobileSettingsWindow" parent="AdwApplicationWindow">
    <property name="title" translatable="yes">Mobile Settings</property>
    <property name="default-width">600</property>
    <property name="default-height">300</property>
    <child>
      <object class="AdwLeaflet" id="main_leaflet">
        <property name="can-navigate-back">True</property>
        <child>
          <object class="GtkBox">
            <property name="orientation">vertical</property>
            <child>
              <object class="AdwHeaderBar">
                <property name="show-end-title-buttons" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
                <child type="end">
                  <object class="GtkMenuButton">
                    <property name="menu-model">primary_menu</property>
                    <property name="icon-name">open-menu-symbolic</property>
                  </object>
                </child>
              </object>
            </child>

            <child>
              <object class="MsPanelSwitcher">
                <property name="width-request">270</property>
                <property name="vexpand">True</property>
                <property name="stack">stack</property>
                <signal name="row-activated" handler="on_switcher_row_activated" after="yes" swapped="yes"/>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="AdwLeafletPage">
            <property name="navigatable">False</property>
            <property name="child">
              <object class="GtkSeparator" id="panel_separator">
                <property name="orientation">vertical</property>
                <style>
                  <class name="sidebar"/>
                </style>
              </object>
            </property>
          </object>
        </child>

        <child>
          <object class="GtkBox">
            <property name="orientation">vertical</property>
            <property name="hexpand">True</property>
            <child>
              <object class="AdwHeaderBar">
                <property name="show-start-title-buttons" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
                <property name="title-widget">
                  <object class="AdwWindowTitle">
                    <property name="visible" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
                    <binding name="title">
                      <closure type='gchararray' function='stack_child_to_tile'>
                        <constant>stack</constant>
                        <lookup name="visible-child">stack</lookup>
                      </closure>
                    </binding>
                  </object>
                </property>
                <child type="start">
                  <object class="GtkButton" id="back">
                    <property name="valign">center</property>
                    <property name="tooltip-text" translatable="yes">Back</property>
                    <property name="icon-name">go-previous-symbolic</property>
                    <property name="visible" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
                    <signal name="clicked" handler="on_back_clicked" swapped="yes"/>
                  </object>
                </child>
              </object>
            </child>

            <child>
              <object class="GtkStack" id="stack">
                <property name="vexpand">True</property>
                <property name="vhomogeneous">False</property>
                <property name="margin-top">12</property>
                <property name="margin-bottom">12</property>
                <property name="margin-start">12</property>
                <property name="margin-end">12</property>
                <signal name="notify::visible-child" handler="on_visible_child_changed" after="yes" swapped="yes"/>

                <child>
                  <object class="GtkStackPage">
                    <property name="title" translatable="yes">Welcome</property>
                    <property name="name">welcome</property>
                    <property name="icon-name">starred-symbolic</property>
                    <property name="child">
                      <object class="AdwStatusPage">
                        <property name="icon-name">org.sigxcpu.MobileSettings-symbolic</property>
                        <property name="title" translatable="yes">Welcome to Mobile Settings</property>
                        <property name="description" translatable="yes">Tweak advanced mobile settings</property>
                      </object>
                    </property>
                  </object>
                </child>

                <child>
                  <object class="GtkStackPage">
                    <property name="title" translatable="yes">Feedback</property>
                    <property name="name">feedback</property>
                    <property name="icon-name">feedback-quiet-symbolic</property>
                    <property name="child">
                      <object class="MsFeedbackPanel"/>
                    </property>
                  </object>
                </child>

                <child>
                  <object class="GtkStackPage">
                    <property name="title" translatable="yes">Compositor</property>
                    <property name="name">compositor</property>
                    <property name="icon-name">phone-docked-symbolic</property>
                    <property name="child">
                      <object class="MsCompositorPanel" id="compositor_page"/>
                    </property>
                  </object>
                </child>

                <child>
                  <object class="GtkStackPage">
                    <property name="title" translatable="yes">Lockscreen</property>
                    <property name="name">lockscreen</property>
                    <property name="icon-name">padlock-symbolic</property>
                    <property name="child">
                      <object class="MsLockscreenPanel" id="lockscreen_page"/>
                    </property>
                  </object>
                </child>

                <child>
                  <object class="GtkStackPage">
                    <property name="title" translatable="yes">Convergence</property>
                    <property name="name">convergence</property>
                    <property name="icon-name">phonelink2-symbolic</property>
                    <property name="child">
                      <object class="MsConvergencePanel" id="convergence_page"/>
                    </property>
                  </object>
                </child>

              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>

  <menu id="primary_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
        <attribute name="action">win.show-help-overlay</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_About Mobile Settings</attribute>
        <attribute name="action">app.about</attribute>
      </item>
    </section>
  </menu>
</interface>
