Update and rename prefs.js to prefs_legacy.js

This commit is contained in:
2025-07-29 23:45:53 +02:00
committed by GitHub
parent 1daeb0e100
commit 749e3a0275
+15 -35
View File
@@ -1,11 +1,10 @@
// ------------------------------------------------------ // ///////////////////////////////////////////////////////////////
// Extension Settings Menu for Simple Tiling - Version 6 // // SimpleTiling  LEGACY MENU (GNOME Shell 3.38  44) //
// © 2025 domoel MIT // // © 2025domoel  MIT //
// ------------------------------------------------------ // /////////////////////////////////////////////////////////////
// ---------------------------------------------------- //
// Global Imports // // ── GLOBAL IMPORTS ────────────────────────────────────────
// ---------------------------------------------------- //
"use strict"; "use strict";
const { Gtk, GObject, Gio } = imports.gi; const { Gtk, GObject, Gio } = imports.gi;
@@ -13,9 +12,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
const SCHEMA_NAME = "org.gnome.shell.extensions.simple-tiling.domoel"; const SCHEMA_NAME = "org.gnome.shell.extensions.simple-tiling.domoel";
// ---------------------------------------------------- // // ── DEFINITIONS ────────────────────────────────────────────
// Definition of Row Model //
// ---------------------------------------------------- //
const COLUMN_ID = 0; const COLUMN_ID = 0;
const COLUMN_DESC = 1; const COLUMN_DESC = 1;
const COLUMN_KEY = 2; const COLUMN_KEY = 2;
@@ -36,9 +33,7 @@ function buildPrefsWidget() {
visible: true, visible: true,
}); });
// ---------------------------------------------------- // // ── KEYBINDINGS ────────────────────────────────────────────
// Section for Keybindings //
// ---------------------------------------------------- //
const keysTitle = new Gtk.Label({ const keysTitle = new Gtk.Label({
label: "<b>Keybindings</b>", label: "<b>Keybindings</b>",
use_markup: true, use_markup: true,
@@ -122,9 +117,7 @@ function buildPrefsWidget() {
prefsWidget.add(keysFrame); prefsWidget.add(keysFrame);
// ---------------------------------------------------- // // ── WINDOW GAPS ────────────────────────────────────────────
// Section for Window Gaps //
// ---------------------------------------------------- //
const gapsTitle = new Gtk.Label({ const gapsTitle = new Gtk.Label({
label: "<b>Window Gaps</b>", label: "<b>Window Gaps</b>",
use_markup: true, use_markup: true,
@@ -145,26 +138,12 @@ function buildPrefsWidget() {
gapsFrame.add(gapsGrid); gapsFrame.add(gapsGrid);
addSpinButtonRow(gapsGrid, settings, "Inner Gap", "inner-gap", 0); addSpinButtonRow(gapsGrid, settings, "Inner Gap", "inner-gap", 0);
addSpinButtonRow( addSpinButtonRow(gapsGrid, settings, "Outer Gap (horizontal)", "outer-gap-horizontal", 1);
gapsGrid, addSpinButtonRow(gapsGrid, settings, "Outer Gap (vertical)", "outer-gap-vertical", 2);
settings,
"Outer Gap (horizontal)",
"outer-gap-horizontal",
1
);
addSpinButtonRow(
gapsGrid,
settings,
"Outer Gap (vertical)",
"outer-gap-vertical",
2
);
prefsWidget.add(gapsFrame); prefsWidget.add(gapsFrame);
// ---------------------------------------------------- // // ── WINDOW BEHAVIOR ────────────────────────────────────────────
// Section for Window Behavior (Master vs. Stack) //
// ---------------------------------------------------- //
const behaviorTitle = new Gtk.Label({ const behaviorTitle = new Gtk.Label({
label: "<b>Window Behavior</b>", label: "<b>Window Behavior</b>",
use_markup: true, use_markup: true,
@@ -191,7 +170,8 @@ function buildPrefsWidget() {
0 0
); );
prefsWidget.add(behaviorFrame); prefsWidget.add(behaviorFrame);
prefsWidget.show_all();
return prefsWidget; return prefsWidget;
} }
@@ -215,7 +195,7 @@ function addSpinButtonRow(grid, settings, desc, key, pos) {
visible: true, visible: true,
}); });
grid.attach(label, 0, pos, 1, 1); grid.attach(label, 0, pos, 1, 1);
const adj = new Gtk.Adjustment({ lower: 0, upper: 50, step_increment: 1 }); const adj = new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 });
const spin = new Gtk.SpinButton({ const spin = new Gtk.SpinButton({
adjustment: adj, adjustment: adj,
climb_rate: 1, climb_rate: 1,