<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="3.20"/>
  <requires lib="libhandy" version="0.0"/>
  <template class="EphyHistoryDialog" parent="AdwDialog">
    <property name="content-width">640</property>
    <property name="content-height">580</property>
    <property name="title" translatable="yes">History</property>
    <child>
      <object class="AdwToolbarView">
        <child type="top">
          <object class="GtkStack" id="header_bars_stack">
            <property name="transition-type">crossfade</property>
            <child>
              <object class="AdwHeaderBar" id="window_header_bar">
                <child type="start">
                  <object class="GtkButton" id="clear_button">
                    <child>
                      <object class="AdwButtonContent">
                        <property name="label" translatable="yes">Clear</property>
                        <property name="icon-name">user-trash-symbolic</property>
                      </object>
                    </child>
                    <signal name="clicked" handler="on_clear_button_clicked"/>
                  </object>
                </child>
                <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="AdwHeaderBar" id="selection_header_bar">
                <property name="show-end-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 type="top">
          <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="AdwSpinner" 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">No History Found</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 type="bottom">
          <object class="GtkRevealer" id="action_bar_revealer">
            <property name="transition-type">slide-up</property>
            <property name="transition-duration">500</property>
            <child>
              <object class="GtkActionBar">
                <child type="end">
                  <object class="GtkButton" id="selection_delete_button">
                    <property name="label" translatable="yes">_Delete</property>
                    <property name="sensitive">False</property>
                    <property name="use_underline">True</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="label" translatable="yes">_Open</property>
                    <property name="sensitive">False</property>
                    <property name="use_underline">True</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>
