-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathprefs.js
56 lines (45 loc) · 1.36 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
'use strict';
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
function init() {
}
function buildPrefsWidget() {
this.settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.fullscreenworkspace');
let prefsWidget = new Gtk.Grid({
column_spacing: 12,
row_spacing: 12,
visible: true
});
prefsWidget.set_margin_start(12);
prefsWidget.set_margin_end(12);
prefsWidget.set_margin_top(12);
prefsWidget.set_margin_bottom(12);
let title = new Gtk.Label({
label: `<b>${Me.metadata.name} Preferences</b>`,
halign: Gtk.Align.START,
use_markup: true,
visible: true
});
prefsWidget.attach(title, 0, 0, 2, 1);
let toggleLabel = new Gtk.Label({
label: 'Maximized windows on separate workspace',
halign: Gtk.Align.START,
visible: true
});
prefsWidget.attach(toggleLabel, 0, 1, 1, 1);
let toggle = new Gtk.Switch({
active: this.settings.get_boolean ('maximized-windows'),
halign: Gtk.Align.END,
visible: true
});
prefsWidget.attach(toggle, 1, 1, 1, 1);
this.settings.bind(
'maximized-windows',
toggle,
'active',
Gio.SettingsBindFlags.DEFAULT
);
return prefsWidget;
}