-
Notifications
You must be signed in to change notification settings - Fork 12
/
prefs.js
33 lines (27 loc) · 851 Bytes
/
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
import Adw from 'gi://Adw';
import Gio from 'gi://Gio';
import Gtk from 'gi://Gtk';
import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
function _addToggle(group, settings, title, key)
{
const toggleRow = new Adw.SwitchRow({
title: title,
active: settings.get_boolean(key),
});
settings.bind(key, toggleRow, 'active',
Gio.SettingsBindFlags.DEFAULT);
group.add(toggleRow);
}
export default class PipOnTopPrefs extends ExtensionPreferences {
fillPreferencesWindow(window)
{
const settings = this.getSettings();
const page = new Adw.PreferencesPage();
const group = new Adw.PreferencesGroup({
title: 'Options',
});
_addToggle(group, settings, 'Show on all workspaces', 'stick');
page.add(group);
window.add(page);
}
}