File: pps-sidebar-annotations.blp

package info (click to toggle)
papers 49.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 21,140 kB
  • sloc: ansic: 37,721; sh: 197; xml: 127; makefile: 112
file content (83 lines) | stat: -rw-r--r-- 1,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using Gtk 4.0;
using Adw 1;

template $PpsSidebarAnnotations: $PpsSidebarPage {
  child: Box {
    orientation: vertical;

    Adw.ViewStack stack {
      Adw.ViewStackPage {
        name: "empty";

        child: Adw.StatusPage {
          title: _("No Annotations");
          icon-name: "chat-bubble-text-symbolic";

          styles [
            "compact",
          ]
        };
      }

      Adw.ViewStackPage {
        name: "annot";

        child: ScrolledWindow {
          halign: fill;
          hexpand: true;
          vexpand: true;

          child: ListView list_view {
            styles [
              "navigation-sidebar",
            ]

            hexpand: true;
            tab-behavior: item;

            factory: SignalListItemFactory factory {
              setup => $list_view_factory_setup() swapped;
              bind => $list_view_factory_bind() swapped;
            };

            model: SingleSelection selection_model {};
          };
        };
      }
    }

    PopoverMenu popup {
      has-arrow: false;
      halign: start;
      menu-model: annotation-popup;
    }
  };
}

menu annotation-popup {
  section {
    item {
      label: _("Annotation Properties");
      action: "doc.annot-properties";
      hidden-when: "action-disabled";
    }

    item {
      label: _("Remove Annotation");
      action: "doc.remove-annot";
      hidden-when: "action-disabled";
    }

    item {
      label: _("_Open Attachment");
      action: "doc.open-attachment";
      hidden-when: "action-disabled";
    }

    item {
      label: _("_Save Attachment As…");
      action: "doc.save-attachment";
      hidden-when: "action-disabled";
    }
  }
}