-
Notifications
You must be signed in to change notification settings - Fork 1
/
prefs.js
50 lines (40 loc) · 1.29 KB
/
prefs.js
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
'use strict';
const { Adw, Gio, Gtk } = imports.gi;
const ExtensionUtils = imports.misc.extensionUtils;
const Extension = ExtensionUtils.getCurrentExtension();
const _ = (text, context) => {
return context ? ExtensionUtils.pgettext(context, text) : ExtensionUtils.gettext(text);
};
var init = () => {
ExtensionUtils.initTranslations(Extension.uuid);
};
var fillPreferencesWindow = (window) => {
window._settings = ExtensionUtils.getSettings();
const delaySpinBox = new Gtk.SpinButton({
adjustment: new Gtk.Adjustment({
lower: 0,
upper: 5000,
step_increment: 1,
}),
valign: Gtk.Align.CENTER,
});
window._settings.bind(
`delay`,
delaySpinBox,
`value`,
Gio.SettingsBindFlags.DEFAULT
);
const delayRow = new Adw.ActionRow({
activatable_widget: delaySpinBox,
subtitle: _(`Delay in applying the workaround (increase if it doesn't work for you)`),
title: _(`Delay (in milliseconds)`),
});
delayRow.add_suffix(delaySpinBox);
const generalGroup = new Adw.PreferencesGroup({
title: _(`General`, `General options`),
});
generalGroup.add(delayRow);
const page = new Adw.PreferencesPage();
page.add(generalGroup);
window.add(page);
};