<?xml version="1.0" encoding="UTF-8"?>
<interface domain="blur-my-shell@aunetx">
  <template class="Dash" parent="AdwPreferencesPage">
    <property name="name">dash</property>
    <property name="title" translatable="yes">Dash</property>
    <property name="icon-name">dash-symbolic</property>

    <child>
      <object class="AdwPreferencesGroup">
        <property name="title" translatable="yes">Dash to Dock blur</property>
        <property name="description" translatable="yes">Blur the background of the Dash to Dock extension, if it is used.</property>
        <property name="header-suffix">
          <object class="GtkSwitch" id="blur">
            <property name="valign">center</property>
          </object>
        </property>

        <child>
          <object class="AdwActionRow">
            <property name="title" translatable="yes">Blur type</property>
            <property name="subtitle" translatable="yes">The dynamic blur is slower and only compatible with a gaussian blur effect.</property>
            <property name="activatable-widget">blur_mode_choose</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />

            <child>
              <object class="GtkBox" id="blur_mode_choose">
                <property name="valign">center</property>
                <property name="hexpand">false</property>
                <style>
                  <class name="linked" />
                </style>

                <child>
                  <object class="GtkToggleButton" id="mode_static">
                    <property name="valign">center</property>
                    <property name="hexpand">true</property>
                    <property name="group">mode_dynamic</property>
                    <property name="child">
                      <object class="AdwButtonContent">
                        <property name="icon-name">static-mode-symbolic</property>
                        <property name="label" translatable="yes">Static</property>
                      </object>
                    </property>
                  </object>
                </child>
                <child>
                  <object class="GtkToggleButton" id="mode_dynamic">
                    <property name="valign">center</property>
                    <property name="hexpand">true</property>
                    <property name="child">
                      <object class="AdwButtonContent">
                        <property name="icon-name">dynamic-mode-symbolic</property>
                        <property name="label" translatable="yes">Dynamic</property>
                      </object>
                    </property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="PipelineChooseRow" id="pipeline_choose_row">
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
          </object>
        </child>

        <child>
          <object class="AdwActionRow" id="sigma_row">
            <property name="title" translatable="yes">Sigma</property>
            <property name="subtitle" translatable="yes">The intensity of the blur.</property>
            <property name="activatable-widget">sigma_scale</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />

            <child>
              <object class="GtkScale" id="sigma_scale">
                <property name="valign">center</property>
                <property name="hexpand">true</property>
                <property name="width-request">200px</property>
                <property name="draw-value">true</property>
                <property name="value-pos">right</property>
                <property name="digits">0</property>
                <property name="adjustment">sigma</property>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="AdwActionRow" id="brightness_row">
            <property name="title" translatable="yes">Brightness</property>
            <property name="subtitle" translatable="yes">The brightness of the blur effect, a high value might make the text harder to read.</property>
            <property name="activatable-widget">brightness_scale</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />

            <child>
              <object class="GtkScale" id="brightness_scale">
                <property name="valign">center</property>
                <property name="hexpand">true</property>
                <property name="width-request">200px</property>
                <property name="draw-value">true</property>
                <property name="value-pos">right</property>
                <property name="digits">2</property>
                <property name="adjustment">brightness</property>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="AdwActionRow" id="corner_radius_not_found_row">
            <property name="title" translatable="yes">Corner radius</property>
            <property name="subtitle" translatable="yes">In order to use rounded corners, please install the GNOME Rounded Blur library.</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
            <property name="activatable-widget">open_gnome_rounded_blur</property>

            <child type="suffix">
              <object class="GtkButton" id="open_gnome_rounded_blur">
                <property name="icon-name">external-link-symbolic</property>
                <property name="valign">center</property>
                <property name="action-name">link.open-gnome-rounded-blur</property>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="AdwSpinRow" id="corner_radius_row">
            <property name="title" translatable="yes">Corner radius</property>
            <property name="subtitle" translatable="yes">Radius for the corner rounding effect.</property>
            <property name="adjustment">corner_radius</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
          </object>
        </child>

        <child>
          <object class="AdwExpanderRow" id="override_background">
            <property name="title" translatable="yes">Override background</property>
            <property name="subtitle" translatable="yes">Makes the background either transparent or semi-transparent, disable this to use Dash to Dock preferences instead.</property>
            <property name="show-enable-switch">true</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />

            <child>
              <object class="AdwActionRow">
                <property name="title" translatable="yes">Background style</property>
                <property name="subtitle" translatable="yes">The transparent/semi-transparent style for the dock background.</property>
                <property name="activatable-widget">style_dash_to_dock</property>

                <child>
                  <object class="GtkDropDown" id="style_dash_to_dock">
                    <property name="valign">center</property>
                    <property name="model">style_dash_to_dock_model</property>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>

        <child>
          <object class="AdwActionRow">
            <property name="title" translatable="yes">Disable in overview</property>
            <property name="subtitle" translatable="yes">Disables the blur from Dash to Dock when entering the overview.</property>
            <property name="activatable-widget">unblur_in_overview</property>
            <property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />

            <child>
              <object class="GtkSwitch" id="unblur_in_overview">
                <property name="valign">center</property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>

  <object class="GtkAdjustment" id="sigma">
    <property name="lower">0</property>
    <property name="upper">100</property>
    <property name="step-increment">1</property>
  </object>

  <object class="GtkAdjustment" id="brightness">
    <property name="lower">0.0</property>
    <property name="upper">1.0</property>
    <property name="step-increment">0.01</property>
  </object>
  
  <object class="GtkAdjustment" id="corner_radius">
    <property name="lower">0</property>
    <property name="upper">150</property>
    <property name="step-increment">1</property>
  </object>

  <object class="GtkStringList" id="style_dash_to_dock_model">
    <items>
      <item translatable="yes">Transparent</item>
      <item translatable="yes">Light</item>
      <item translatable="yes">Dark</item>
    </items>
  </object>
</interface>
