-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprefs.js
56 lines (48 loc) · 1.65 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';
import Gtk from 'gi://Gtk?version=4.0';
import Adw from 'gi://Adw';
import GObject from 'gi://GObject';
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import { Wallpapers } from './preferences/wallpaper.js'
export default class ExamplePreferences extends ExtensionPreferences {
/**
* This class is constructed once when your extension preferences are
* about to be opened. This is a good time to setup translations or anything
* else you only do once.
*
* @param {ExtensionMeta} metadata - An extension meta object
*/
constructor(metadata) {
super(metadata);
// console.debug(`constructing ${this.metadata.name}`);
}
/**
* This function is called when the preferences window is first created to
* build and return a GTK4 widget.
*
* The preferences window will be a `Adw.PreferencesWindow`, and the widget
* returned by this function will be added to an `Adw.PreferencesPage` or
* `Adw.PreferencesGroup` if necessary.
*
* @returns {Gtk.Widget} the preferences widget
*/
getPreferencesWidget() {
// return new Gtk.Label({
// label: this.metadata.name,
// });
}
/**
* Fill the preferences window with preferences.
*
* If this method is overridden, `getPreferencesWidget()` will NOT be called.
*
* @param {Adw.PreferencesWindow} window - the preferences window
*/
fillPreferencesWindow(window) {
window.search_enabled = true;
window.set_default_size(500, 630);
GObject.type_ensure(Wallpapers);
let preferencesPage = new Wallpapers({ settings: this.getSettings(`${this.metadata['settings-schema']}`) });
window.add(preferencesPage);
}
}