forked from Aryan20/Logomenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprefs.js
49 lines (39 loc) · 1.26 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
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const PrefsLib = Me.imports.PrefsLib;
const {Gtk, GObject} = imports.gi;
const Config = imports.misc.config;
const [major] = Config.PACKAGE_VERSION.split('.');
const shellVersion = Number.parseInt(major);
let Settings = ExtensionUtils.getSettings(Me.metadata['settings-schema']);
function init() {
ExtensionUtils.initTranslations(Me.metadata['gettext-domain']);
}
var IconGrid = GObject.registerClass(class Logo_Menu_IconGrid extends Gtk.FlowBox{
_init() {
super._init({
row_spacing: 10,
column_spacing: 10,
vexpand: false,
hexpand: true,
valign: Gtk.Align.START,
halign: Gtk.Align.CENTER,
homogeneous: true,
selection_mode: Gtk.SelectionMode.SINGLE,
margin_top: 5,
});
this.childrenCount = 0;
}
add(widget){
this.insert(widget, -1);
this.childrenCount++;
}
});
function fillPreferencesWindow(window)
{
PrefsLib.adw.fillPrefsWindow(window, IconGrid, Settings);
}
function buildPrefsWidget()
{
return PrefsLib.gtk.getMainPrefs(IconGrid, shellVersion, Settings);
}