<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="adw" version="1.0"/>
  <template class="ApostropheSearchBar" parent="AdwBin">
    <!--<signal name="size-allocate" handler="update_textview_margin" swapped="no"/>-->
    <child>
      <object class="GtkSearchBar" id="searchbar">
        <property name="search-mode-enabled" bind-source="ApostropheSearchBar" bind-property="search-mode-enabled"/>
        <child>
          <object class="GtkBox" id="searchpanel_box">
            <property name="orientation">vertical</property>
            <property name="halign">center</property>
            <child>
              <object class="GtkBox" id="search_box">
                <property name="spacing">6</property>
                <child>
                  <object class="GtkBox" id="searchbox_box">
                    <child>
                      <object class="GtkSearchEntry" id="search_entry">
                        <signal name="search-changed" handler="search_entry_changed" swapped="no"/>
                        <signal name="stop-search" handler="hide" swapped="no"/>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="previous_result">
                        <property name="focusable">1</property>
                        <property name="receives-default">1</property>
                        <property name="tooltip-text" translatable="yes">Previous Match</property>
                        <property name="icon-name">go-up-symbolic</property>
                        <property name="sensitive" bind-source="ApostropheSearchBar" bind-property="can_move" bind-flags="sync-create"/>
                        <signal name="clicked" handler="backward_search" swapped="no"/>
                      </object>
                    </child>
                    <child>
                      <object class="GtkButton" id="next_result">
                        <property name="focusable">1</property>
                        <property name="receives-default">1</property>
                        <property name="tooltip-text" translatable="yes">Next Match</property>
                        <property name="icon-name">go-down-symbolic</property>
                        <property name="sensitive" bind-source="ApostropheSearchBar" bind-property="can_move" bind-flags="sync-create"/>
                        <signal name="clicked" handler="forward_search" swapped="no"/>
                      </object>
                    </child>
                    <style>
                      <class name="linked"/>
                    </style>
                  </object>
                </child>
                <child>
                  <object class="GtkBox" id="searchtools_box">
                    <property name="homogeneous">1</property>
                    <child>
                      <object class="GtkToggleButton" id="case_sensitive">
                        <property name="label" translatable="yes" comments="Translators: This indicates case sensitivity, so it should be the first vowel of the language in lowercase and uppercase">aA</property>
                        <property name="focusable">1</property>
                        <property name="receives-default">1</property>
                        <property name="tooltip-text" translatable="yes">Case Sensitive</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkToggleButton" id="regex">
                        <property name="label" translatable="no">(.*)</property>
                        <property name="focusable">1</property>
                        <property name="receives-default">1</property>
                        <property name="tooltip-text" translatable="yes">Regular Expression</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkToggleButton" id="replace">
                        <property name="focusable">1</property>
                        <property name="receives-default">1</property>
                        <property name="tooltip-text" translatable="yes">Replace</property>
                        <property name="active" bind-source="ApostropheSearchBar" bind-property="replace_mode_enabled" bind-flags="bidirectional"/>
                        <property name="icon-name">edit-find-replace-symbolic</property>
                      </object>
                    </child>
                    <style>
                      <class name="linked"/>
                    </style>
                  </object>
                </child>
                
              </object>
            </child>
            <child>
              <object class="GtkRevealer" id="replace_placeholder">
                <property name="reveal-child" bind-source="ApostropheSearchBar" bind-property="replace_mode_enabled"/>
                <property name="child">
                  <object class="GtkBox" id="replace_box">
                    <property name="margin-top">6</property>
                    <property name="spacing">6</property>
                    <child>
                      <object class="GtkBox" id="replacebox_box">
                        <child>
                          <object class="GtkEntry" id="replace_entry">
                            <property name="focusable">1</property>
                            <property name="hexpand">1</property>
                            <property name="primary-icon-name">edit-find-replace-symbolic</property>
                          </object>
                        </child>
                        <style>
                          <class name="linked"/>
                        </style>
                      </object>
                    </child>
                    <child>
                      <object class="GtkBox" id="replacetools_box">
                        <child>
                          <object class="GtkButton" id="replace_one">
                            <property name="label" translatable="yes">Replace</property>
                            <property name="focusable">1</property>
                            <property name="receives-default">1</property>
                            <property name="sensitive" bind-source="ApostropheSearchBar" bind-property="can_replace" bind-flags="sync-create"/>
                            <signal name="clicked" handler="replace_clicked" swapped="no"/>
                          </object>
                        </child>
                        <child>
                          <object class="GtkButton" id="replace_all">
                            <property name="label" translatable="yes">Replace All</property>
                            <property name="focusable">1</property>
                            <property name="receives-default">1</property>
                            <property name="sensitive" bind-source="ApostropheSearchBar" bind-property="can_replace_all" bind-flags="sync-create"/>
                            <signal name="clicked" handler="replace_all" swapped="no"/>
                          </object>
                        </child>
                        <style>
                          <class name="linked"/>
                        </style>
                      </object>
                    </child>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>
