mirror of
https://github.com/zoriya/fairy.git
synced 2026-06-03 03:01:21 +00:00
Create keybind settings page
This commit is contained in:
@@ -7,12 +7,25 @@ const Me = ExtensionUtils.getCurrentExtension();
|
||||
|
||||
function init() { }
|
||||
|
||||
function _createKeybind(settings, keybind) {
|
||||
// TODO: Set the title to the gsettings's title.
|
||||
const row = new Adw.ActionRow({ title: keybind });
|
||||
|
||||
// TODO: Implement a shortcut selector here.
|
||||
const listener = new Gtk.Switch({});
|
||||
// settings.bind(keybind, listener, );
|
||||
row.add_suffix(listener);
|
||||
row.activable_widget = listener;
|
||||
return row
|
||||
}
|
||||
|
||||
function fillPreferencesWindow(window) {
|
||||
const settings = ExtensionUtils.getSettings(
|
||||
"org.gnome.shell.extensions.fairy"
|
||||
);
|
||||
|
||||
const page = new Adw.PreferencesPage();
|
||||
page.set_title("General");
|
||||
const group = new Adw.PreferencesGroup();
|
||||
page.add(group);
|
||||
|
||||
@@ -33,5 +46,16 @@ function fillPreferencesWindow(window) {
|
||||
row.add_suffix(toggle);
|
||||
row.activatable_widget = toggle;
|
||||
|
||||
const keybinds = new Adw.PreferencesPage();
|
||||
keybinds.set_title("Keybinds");
|
||||
const tileBindings = new Adw.PreferencesGroup();
|
||||
keybinds.add(tileBindings);
|
||||
|
||||
tileBindings.add(_createKeybind(settings, "incrmfact"));
|
||||
tileBindings.add(_createKeybind(settings, "decmfact"));
|
||||
tileBindings.add(_createKeybind(settings, "incrnmaster"));
|
||||
tileBindings.add(_createKeybind(settings, "decnmaster"));
|
||||
|
||||
window.add(page);
|
||||
window.add(keybinds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user