<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="Adw" version="1.0"/>
  <template class="LumosWindow" parent="AdwApplicationWindow">
    <property name="default-width">360</property>
    <property name="default-height">640</property>
    <property name="content">
      <object class="AdwToolbarView">
        <child type="top">
          <object class="AdwHeaderBar" id="header_bar">
            <child type="start">
              <!-- ISO Selector in header bar (left) -->
              <object class="GtkDropDown" id="iso_dropdown">
                <property name="model">
                  <object class="GtkStringList">
                    <items>
                      <item translatable="no">ISO 50</item>
                      <item translatable="no">ISO 100</item>
                      <item translatable="no">ISO 200</item>
                      <item translatable="no">ISO 400</item>
                      <item translatable="no">ISO 800</item>
                      <item translatable="no">ISO 1600</item>
                      <item translatable="no">ISO 3200</item>
                      <item translatable="no">ISO 6400</item>
                    </items>
                  </object>
                </property>
                <property name="selected">1</property> <!-- ISO 100 -->
              </object>
            </child>
            <child type="end">
              <object class="GtkMenuButton">
                <property name="primary">True</property>
                <property name="icon-name">open-menu-symbolic</property>
                <property name="tooltip-text" translatable="yes">Menu</property>
                <property name="menu-model">primary_menu</property>
              </object>
            </child>
          </object>
        </child>
        <property name="content">
          <object class="GtkBox">
            <property name="orientation">1</property>

            <!-- Errors banner -->
            <child>
              <object class="AdwBanner" id="error_banner">
                <property name="title" translatable="true">Unable to access light sensor</property>
                <property name="button-label" translatable="true">Details</property>
                <signal name="button-clicked" handler="showErrorDetails"/>"
              </object>
            </child>
            <child>
              <object class="AdwBanner" id="sensor_unit_error_banner">
                <property name="title" translatable="true">Light sensor does not support absolute light measurement: unable to compute exposition</property>
              </object>
            </child>
"

            <!-- Pages Stack -->
            <child>
              <object class="AdwViewStack" id="stack">
                <property name="vexpand">true</property>
                <child>
                  <!-- Aperture priority page -->
                  <object class="AdwViewStackPage" id="aperture-priority-page">
                    <property name="name">aperture-priority-page</property>
                    <property name="title" translatable="true">Aperture</property>
                    <property name="icon-name">camera-shutter-symbolic</property>
                    <property name="use-underline">true</property>
                    <property name="child">
                      <object class="AperturePriorityPage" id="aperture_priority_page_widget">
                      </object>
                    </property>
                  </object>
                </child>

                <!-- Time priority page -->
                <child>
                  <object class="AdwViewStackPage" id="time-priority-page">
                    <property name="name">time-priority-page</property>help
                    <property name="title" translatable="true">Time</property>
                    <property name="icon-name">camera-timer-symbolic</property>
                    <property name="use-underline">true</property>
                    <property name="child">
                      <object class="TimePriorityPage" id="time_priority_page_widget">
                      </object>
                    </property>
                  </object>
                </child>

                <!-- Manual mode page -->
                <child>
                  <object class="AdwViewStackPage" id="manual-mode-page">
                    <property name="name">manual-mode-page</property>
                    <property name="title" translatable="true">Manual</property>
                    <property name="icon-name">encoder-knob-symbolic</property>
                    <property name="use-underline">true</property>
                    <property name="child">
                      <object class="ManualExposurePage" id="manual_page_widget">
                      </object>
                    </property>
                  </object>
                </child>

                <!-- Sensor readings page -->
                <child>
                  <object class="AdwViewStackPage" id="sensor_readings_page">
                    <property name="name">sensor_readings_page</property>
                    <property name="title" translatable="true">Light</property>
                    <property name="icon-name">lightbulb-symbolic</property>
                    <property name="use-underline">true</property>
                    <property name="child">
                      <object class="SensorReadingsPage" id="sensor_readings_page_widget">
                      </object>
                    </property>
                  </object>
                </child>

              </object>
            </child>

            <!-- Bottom tab bar -->
            <child>
              <object class="AdwViewSwitcher" id="switcher_title">
                <property name="stack">stack</property>
                <property name="margin-bottom">8</property>
                <property name="margin-start">2</property>
                <property name="margin-end">2</property>
              </object>
            </child>

          </object>
        </property>
      </object>
    </property>
  </template>
  <menu id="primary_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes">_Preferences</attribute>
        <attribute name="action">app.preferences</attribute>
      </item>
      <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 Lumos</attribute>
        <attribute name="action">app.about</attribute>
      </item>
    </section>
  </menu>
</interface>

