This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
prefs.js
97 lines (83 loc) · 2.77 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
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
"use strict";
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const ExtensionUtils = imports.misc.extensionUtils;
const Extension = ExtensionUtils.getCurrentExtension();
function init() {}
function buildPrefsWidget() {
this.settings = ExtensionUtils.getSettings();
const prefsWidget = new Gtk.Grid({
margin_top: 20,
margin_bottom: 20,
margin_start: 20,
margin_end: 20,
column_spacing: 12,
row_spacing: 12,
visible: true,
halign: Gtk.Align.CENTER,
});
let title = new Gtk.Label({
label: `<b>Preferences</b>`,
halign: Gtk.Align.CENTER,
use_markup: true,
visible: true
});
prefsWidget.attach(title, 0, 0, 2, 1);
let note = new Gtk.Label({
label: `After any changes turn the extension off and on again.`,
halign: Gtk.Align.CENTER,
use_markup: true,
visible: true
});
prefsWidget.attach(note, 0, 1, 2, 1);
const widgetPositionLabel = new Gtk.Label({
label: "Widget position",
halign: Gtk.Align.START,
visible: true,
});
prefsWidget.attach(widgetPositionLabel, 0, 2, 1, 1);
const widgetPositionComboBox = new Gtk.ComboBoxText();
widgetPositionComboBox.append("right", "Right corner | Status area");
widgetPositionComboBox.append("center", "Center | Date time area");
widgetPositionComboBox.append("left", "Left corner | Activities area");
this.settings.bind(
"widget-position",
widgetPositionComboBox,
"active-id",
Gio.SettingsBindFlags.DEFAULT
);
prefsWidget.attach(widgetPositionComboBox, 1, 2, 1, 1);
const widgetOrientationLabel = new Gtk.Label({
label: "Widget orientation",
halign: Gtk.Align.START,
visible: true,
});
prefsWidget.attach(widgetOrientationLabel, 0, 3, 1, 1);
const widgetOrientationComboBox = new Gtk.ComboBoxText();
widgetOrientationComboBox.append("horizontal", "Horizontal");
widgetOrientationComboBox.append("vertical", "Vertical");
this.settings.bind(
"widget-orientation",
widgetOrientationComboBox,
"active-id",
Gio.SettingsBindFlags.DEFAULT
);
prefsWidget.attach(widgetOrientationComboBox, 1, 3, 1, 1);
const styleLabel = new Gtk.Label({
label: "Icons Style",
halign: Gtk.Align.START,
visible: true,
});
prefsWidget.attach(styleLabel, 0, 4, 1, 1);
const styleComboBox = new Gtk.ComboBoxText();
styleComboBox.append("circles", "Circles");
styleComboBox.append("lines", "Lines");
this.settings.bind(
"icons-style",
styleComboBox,
"active-id",
Gio.SettingsBindFlags.DEFAULT
);
prefsWidget.attach(styleComboBox, 1, 4, 1, 1);
return prefsWidget;
}