forked from forge-ext/forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prefs.js
53 lines (46 loc) · 1.9 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
/*
* This file is part of the Forge GNOME extension
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Gnome imports
import Gdk from "gi://Gdk";
import Gtk from "gi://Gtk";
import { ExtensionPreferences } from "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js";
import { KeyboardPage } from "./lib/prefs/keyboard.js";
import { AppearancePage } from "./lib/prefs/appearance.js";
import { WorkspacePage } from "./lib/prefs/workspace.js";
import { SettingsPage } from "./lib/prefs/settings.js";
export default class ForgeExtensionPreferences extends ExtensionPreferences {
settings = this.getSettings();
kbdSettings = this.getSettings("org.gnome.shell.extensions.forge.keybindings");
constructor(...args) {
super(...args);
const iconPath = this.dir.get_child("resources").get_child("icons").get_path();
const iconTheme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default());
iconTheme.add_search_path(iconPath);
}
fillPreferencesWindow(window) {
this.window = window;
window._settings = this.settings;
window._kbdSettings = this.kbdSettings;
window.add(new SettingsPage(this));
window.add(new AppearancePage(this));
window.add(new WorkspacePage(this));
window.add(new KeyboardPage(this));
window.search_enabled = true;
window.can_navigate_back = true;
}
}