<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.20"/>
  <requires lib="libhandy" version="0.0"/>
  <template class="EphyHistoryDialog" parent="AdwWindow">
    <property name="modal">True</property>
    <property name="default-width">640</property>
    <property name="default-height">580</property>
    <property name="destroy-with_parent">True</property>
    <property name="title" translatable="yes">History</property>
    <child>
      <object class="GtkBox">
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkStack" id="header_bars_stack">
            <property name="transition-type">crossfade</property>
            <child>
              <object class="GtkHeaderBar" id="window_header_bar">
                <child type="end">
                  <object class="GtkButton" id="selection_button">
                    <property name="use-underline">True</property>
                    <property name="icon-name">selection-mode-symbolic</property>
                    <property name="tooltip-text" translatable="yes">Select Items</property>
                    <signal name="clicked" handler="on_selection_button_clicked"/>
                  </object>
                </child>
                <child type="end">
                  <object class="GtkToggleButton" id="search_button">
                    <property name="icon-name">edit-find-symbolic</property>
                    <property name="tooltip-text" translatable="yes">Search</property>
                    <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkHeaderBar" id="selection_header_bar">
                <property name="show-title-buttons">False</property>
                <child type="end">
                  <object class="GtkButton" id="selection_cancel_button">
                    <property name="use-underline">True</property>
                    <property name="label" translatable="yes">_Cancel</property>
                    <signal name="clicked" handler="on_selection_cancel_button_clicked"/>
                  </object>
                </child>
                <child type="end">
                  <object class="GtkToggleButton" id="selection_search_button">
                    <property name="icon-name">edit-find-symbolic</property>
                    <property name="tooltip-text" translatable="yes">Search</property>
                    <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkSearchBar" id="search_bar">
            <property name="search_mode_enabled">False</property>
            <property name="key-capture-widget">EphyHistoryDialog</property>
            <child>
              <object class="AdwClamp">
                <property name="hexpand">True</property>
                <property name="maximum_size">400</property>
                <property name="tightening_threshold">300</property>
                <child>
                  <object class="GtkSearchEntry" id="search_entry">
                    <property name="placeholder-text" translatable="yes">Search history</property>
                    <signal name="search-changed" handler="on_search_entry_changed"/>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkStack" id="history_presentation_stack">
            <property name="vexpand">True</property>
            <child>
              <object class="GtkScrolledWindow" id="history_scrolled_window">
                <signal name="edge-reached" handler="on_edge_reached" object="EphyHistoryDialog" swapped="no"/>
                <child>
                  <object class="GtkViewport">
                    <property name="scroll-to-focus">True</property>
                    <child>
                      <object class="AdwClamp">
                        <property name="margin_start">6</property>
                        <property name="margin_end">6</property>
                        <property name="maximum_size">1024</property>
                        <child>
                          <object class="GtkListBox" id="listbox">
                            <property name="margin_top">6</property>
                            <property name="margin_bottom">6</property>
                            <property name="valign">start</property>
                            <property name="selection_mode">none</property>
                            <property name="activate_on_single_click">True</property>
                            <signal name="row-activated" handler="on_listbox_row_activated"/>
                            <style>
                              <class name="boxed-list"/>
                            </style>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkSpinner" id="loading_spinner">
                <property name="halign">center</property>
                <property name="valign">center</property>
                <property name="width-request">32</property>
                <property name="height-request">32</property>
              </object>
            </child>
            <child>
              <object class="AdwStatusPage" id="empty_history_message">
                <property name="title" translatable="yes">The History is Empty</property>
                <property name="description" translatable="yes">Visited pages will be listed here</property>
              </object>
            </child>
            <child>
              <object class="AdwStatusPage" id="no_search_results_message">
                <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>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkStack" id="action_bars_stack">
            <property name="transition-type">crossfade</property>
            <child>
              <object class="GtkActionBar" id="regular_action_bar">
                <child type="end">
                  <object class="GtkButton" id="clear_all_button">
                    <property name="use-underline">True</property>
                    <property name="label" translatable="yes">_Clear All</property>
                    <signal name="clicked" handler="on_clear_all_button_clicked"/>
                    <style>
                      <class name="destructive-action"/>
                    </style>
                  </object>
                </child>
              </object>
            </child>
            <child>
              <object class="GtkActionBar" id="selection_action_bar">
                <child type="end">
                  <object class="GtkButton" id="selection_delete_button">
                    <property name="sensitive">False</property>
                    <property name="use_underline">True</property>
                    <property name="label" translatable="yes">_Delete</property>
                    <signal name="clicked" handler="on_selection_delete_button_clicked"/>
                    <style>
                      <class name="destructive-action"/>
                    </style>
                  </object>
                </child>
                <child>
                  <object class="GtkButton" id="selection_open_button">
                    <property name="sensitive">False</property>
                    <property name="use_underline">True</property>
                    <property name="label" translatable="yes">_Open</property>
                    <signal name="clicked" handler="on_selection_open_button_clicked"/>
                  </object>
                </child>
              </object>
            </child>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="GtkEventControllerKey">
        <signal name="key-pressed" handler="key_pressed_cb" swapped="yes"/>
        <signal name="key-released" handler="key_released_cb" swapped="yes"/>
      </object>
    </child>
  </template>
</interface>
