<?xml version="1.0" encoding="UTF-8"?>

<!-- This file is part of Wike (com.github.hugolabe.Wike)
SPDX-FileCopyrightText: 2021-25 Hugo Olabera
SPDX-License-Identifier: GPL-3.0-or-later
-->

<!-- History panel for sidebar -->
<interface>
  <template class="HistoryPanel" parent="AdwBin">
    <child>
      <object class="AdwToolbarView">

        <!-- Header -->
        <child type="top">
          <object class="GtkBox">
            <style>
              <class name="toolbar"/>
            </style>

            <!-- Filter selector by days -->
            <child>
              <object class="GtkDropDown" id="filter_dropdown">
                <property name="hexpand">true</property>
              </object>
            </child>

            <!-- Selection mode button -->
            <child>
              <object class="GtkToggleButton" id="selection_button">
                <property name="icon-name">selection-mode-symbolic</property>
                <property name="tooltip-text" translatable="yes">Select</property>
              </object>
            </child>

            <!-- Clear history button -->
            <child>
              <object class="GtkButton" id="clear_button">
                <property name="icon-name">list-remove-all-symbolic</property>
                <property name="tooltip-text" translatable="yes">Clear History</property>
              </object>
            </child>

          </object>
        </child>

        <!-- History scroller -->
        <property name="content">
          <object class="GtkScrolledWindow">
            <child>
              <object class="GtkViewport">

                <!-- History list -->
                <child>
                  <object class="GtkListBox" id="history_list">
                    <property name="vexpand">true</property>
                    <property name="selection-mode">none</property>
                    <style>
                      <class name="navigation-sidebar"/>
                    </style>

                    <!-- Placeholder -->
                    <child type="placeholder">
                      <object class="AdwStatusPage">
                        <property name="title" translatable="yes">Empty History</property>
                        <property name="description" translatable="yes">There are no recent articles in the history</property>
                        <property name="icon-name">document-open-recent-symbolic</property>
                        <property name="margin-start">50</property>
                        <property name="margin-end">50</property>
                        <style>
                          <class name="compact"/>
                        </style>
                      </object>
                    </child>

                  </object>
                </child>

              </object>
            </child>
          </object>
        </property>

        <!-- Actionbar -->
        <child type="bottom">
          <object class="GtkActionBar">
            <property name="revealed">false</property>
            <property name="revealed" bind-source="selection_button" bind-property="active" bind-flags="sync-create"/>

            <!-- Select all languages button -->
            <child type="start">
              <object class="GtkButton" id="select_all_button">
                <property name="icon-name">edit-select-all-symbolic</property>
                <property name="tooltip-text" translatable="yes">Select All</property>
              </object>
            </child>

            <!-- Select none languages button -->
            <child type="start">
              <object class="GtkButton" id="select_none_button">
                <property name="icon-name">edit-select-none-symbolic</property>
                <property name="tooltip-text" translatable="yes">Select None</property>
              </object>
            </child>

            <!-- Remove selected button -->
            <child type="end">
              <object class="GtkButton" id="remove_button">
                <property name="icon-name">app-remove-symbolic</property>
                <property name="tooltip-text" translatable="yes">Remove Selected</property>
                <style>
                  <class name="destructive-action"/>
                </style>
              </object>
            </child>

          </object>
        </child>

      </object>
    </child>
  </template>
</interface>
