-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprefs.js
More file actions
36 lines (30 loc) · 982 Bytes
/
prefs.js
File metadata and controls
36 lines (30 loc) · 982 Bytes
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
import Adw from 'gi://Adw'
import Gio from 'gi://Gio'
import Gtk from 'gi://Gtk'
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'
export default class HideCursorPrefs extends ExtensionPreferences {
fillPreferencesWindow(window) {
const page = new Adw.PreferencesPage({
title: 'General',
icon_name: 'dialog-information-symbolic',
})
window.add(page)
const group = new Adw.PreferencesGroup({
title: _('Cursor Hiding'),
})
page.add(group)
const timeoutRow = new Adw.SpinRow({
title: _('Hide cursor after (seconds)'),
adjustment: new Gtk.Adjustment({
lower: 1,
upper: 30,
step_increment: 1,
page_increment: 5,
value: this.getSettings().get_int('timeout'),
}),
numeric: true,
})
this.getSettings().bind('timeout', timeoutRow, 'value', Gio.SettingsBindFlags.DEFAULT)
group.add(timeoutRow)
}
}