<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk" version="4.0" />
  <requires lib="libadwaita" version="1.0" />
  <template class="PpsSidebarAnnotations" parent="PpsSidebarPage">
    <property name="child">
      <object class="GtkBox">
        <property name="orientation">vertical</property>
        <child>
          <object class="AdwViewStack" id="stack">
            <child>
              <object class="AdwViewStackPage">
                <property name="name">empty</property>
                <property name="child">
                  <object class="AdwStatusPage">
                    <property name="title" translatable="yes">No Annotations</property>
                    <property name="icon-name">chat-bubble-text-symbolic</property>
                    <style>
                      <class name="compact" />
                    </style>
                  </object>
                </property>
              </object>
            </child>
            <child>
              <object class="AdwViewStackPage">
                <property name="name">annot</property>
                <property name="child">
                  <object class="GtkScrolledWindow">
                    <property name="halign">fill</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <property name="child">
                      <object class="GtkListView" id="list_view">
                        <style>
                          <class name="navigation-sidebar"/>
                        </style>
                        <property name="hexpand">True</property>
                        <property name="factory">
                          <object class="GtkSignalListItemFactory" id="factory">
                            <signal name="setup" handler="list_view_factory_setup" swapped="yes" />
                            <signal name="bind" handler="list_view_factory_bind" swapped="yes" />
                          </object>
                        </property>
                        <property name="model">
                          <object class="GtkSingleSelection" id="selection">
                            <property name="model">
                              <object class="GListStore" id="model">
                                <property name="item-type">PpsAnnotation</property>
                              </object>
                            </property>
                          </object>
                        </property>
                      </object>
                    </property>
                  </object>
                </property>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkPopoverMenu" id="popup">
            <property name="has-arrow">False</property>
            <property name="halign">start</property>
            <property name="menu-model">annotation-popup</property>
          </object>
        </child>
      </object>
    </property>
  </template>
  <menu id="annotation-popup">
    <section>
      <item>
        <attribute name="label" translatable="yes">Annotation Properties</attribute>
        <attribute name="action">doc.annot-properties</attribute>
        <attribute name='hidden-when'>action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">Remove Annotation</attribute>
        <attribute name="action">doc.remove-annot</attribute>
        <attribute name='hidden-when'>action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Open Attachment</attribute>
        <attribute name="action">doc.open-attachment</attribute>
        <attribute name='hidden-when'>action-disabled</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Save Attachment As…</attribute>
        <attribute name="action">doc.save-attachment</attribute>
        <attribute name='hidden-when'>action-disabled</attribute>
      </item>
    </section>
  </menu>
</interface>
