File: window.blp

package info (click to toggle)
blanket 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,180 kB
  • sloc: python: 1,621; xml: 102; sh: 7; makefile: 6
file content (216 lines) | stat: -rw-r--r-- 3,736 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
using Gtk 4.0;
using Adw 1;

template $BlanketWindow : Adw.ApplicationWindow {
  default-width: 520;
  default-height: 600;
  width-request: 360;
  height-request: 294;

  Adw.Breakpoint {
    condition ("max-width: 360px")

    apply => $_on_narrow_window_apply();
    unapply => $_on_narrow_window_unapply();
  }

  Adw.ToolbarView {
    bottom-bar-style: raised;

    [top]
    Adw.HeaderBar headerbar {
      $PresetChooser presets_chooser {
        visible: "False";
        tooltip-text: _("Presets Menu");
      }

      [end]
      MenuButton {
        menu-model: primary-menu;
        icon-name: "open-menu-symbolic";
        tooltip-text: _("Main Menu");
      }
    }

    Adw.ToastOverlay toast_overlay {
      ScrolledWindow {
        hscrollbar-policy: never;
        hexpand: true;
        vexpand: true;

        FlowBox grid {
          activate-on-single-click: true;
          column-spacing: 12;
          row-spacing: 12;
          homogeneous: true;
          selection-mode: none;
          valign: start;

          styles [
            "sound-view",
          ]
        }
      }
    }

    [bottom]
    ActionBar {
      [center]
      Box {
        spacing: 24;

        MenuButton {
          popover: volumes;
          valign: center;
          icon-name: "audio-speakers-symbolic";
          direction: up;
          tooltip-text: _("Volume Menu");

          styles [
            "circular",
          ]
        }

        $PlayPauseButton playpause_btn {
          action-name: "app.playpause";
          tooltip-text: _("Play/Pause Sounds");
        }

        MenuButton {
          menu-model: more-menu;
          valign: center;
          icon-name: "view-more-symbolic";
          direction: up;
          tooltip-text: _("Sounds Menu");

          styles [
            "circular",
          ]
        }
      }
    }
  }
}

menu primary-menu {
  section {
    item {
      label: _("Keep Playing when Closed");
      action: "app.background-playback";
    }
  }

  section {
    item {
      label: _("Preferences");
      action: "app.preferences";
    }

    item {
      label: _("Keyboard Shortcuts");
      action: "win.show-help-overlay";
    }

    item {
      label: _("About Blanket");
      action: "app.about";
    }
  }

  section {
    item {
      label: _("Quit");
      action: "app.quit";
    }
  }
}

menu volume-menu {
  section {
    item {
      custom: "volumes";
    }
  }

  section {
    item {
      label: _("Reset Sounds");
      action: "app.reset-volumes";
    }
  }
}

menu more-menu {
  section {
    item {
      label: _("Hide Inactive Sounds");
      action: "win.hide-inactive";
    }

    item {
      label: _("Save as New Preset…");
      action: "app.add-preset";
    }
  }
  section {
    item {
      label: _("Add Sound…");
      action: "app.open";
    }
  }
}

PopoverMenu volumes {
  menu-model: volume-menu;
  width-request: 250;

  [volumes]
  Box {
    orientation: vertical;
    spacing: 6;

    Scale volume {
      hexpand: true;
      adjustment: volume_adjustment;
      draw-value: false;
    }

    Box volume_box {
      orientation: vertical;
      visible: false;

      Separator {
        styles [
          "volume-separator",
        ]
      }

      ScrolledWindow {
        propagate-natural-height: true;
        max-content-height: 320;

        ListBox volume_list {
          selection-mode: none;
        }
      }
    }
  }
}

SizeGroup labels_group {
  mode: vertical;
}

Adjustment volume_adjustment {
  lower: 0;
  upper: 1;
  step-increment: 0.01;
  page-increment: 0.01;
}

Adw.Toast power_toast {
  title: _("Paused to save power");
  action-name: "app.play";
  button-label: _("_Resume Playing");
  timeout: 0;
}