split files
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
// Simple‑Tiling – MODERN (GNOME Shell 45+) //
|
// Simple‑Tiling – MODERN (GNOME Shell 45-48) //
|
||||||
// © 2025 domoel – MIT //
|
// © 2025 domoel – MIT //
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -347,8 +347,8 @@ class Tiler {
|
|||||||
if (index > -1) this._centerTimeoutIds.splice(index, 1);
|
if (index > -1) this._centerTimeoutIds.splice(index, 1);
|
||||||
|
|
||||||
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
|
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
|
||||||
if (win.is_maximized())
|
if (win.get_maximized())
|
||||||
win.unmaximize();
|
win.unmaximize(Meta.MaximizeFlags.BOTH);
|
||||||
|
|
||||||
const monitorIndex = win.get_monitor();
|
const monitorIndex = win.get_monitor();
|
||||||
const workspace = this._workspaceManager.get_active_workspace();
|
const workspace = this._workspaceManager.get_active_workspace();
|
||||||
@@ -558,7 +558,7 @@ class Tiler {
|
|||||||
height: workArea.height - 2 * this._outerGapVertical,
|
height: workArea.height - 2 * this._outerGapVertical,
|
||||||
};
|
};
|
||||||
windowsToTile.forEach((win) => {
|
windowsToTile.forEach((win) => {
|
||||||
if (win.is_maximized()) win.unmaximize();
|
if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH);
|
||||||
});
|
});
|
||||||
if (windowsToTile.length === 1) {
|
if (windowsToTile.length === 1) {
|
||||||
windowsToTile[0].move_resize_frame(
|
windowsToTile[0].move_resize_frame(
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
// Simple‑Tiling – MODERN (GNOME Shell 45+) //
|
// Simple‑Tiling – MODERN (GNOME Shell 49+) //
|
||||||
// © 2025 domoel – MIT //
|
// © 2025 domoel – MIT //
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -347,8 +347,8 @@ class Tiler {
|
|||||||
if (index > -1) this._centerTimeoutIds.splice(index, 1);
|
if (index > -1) this._centerTimeoutIds.splice(index, 1);
|
||||||
|
|
||||||
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
|
if (!win || !win.get_display()) return GLib.SOURCE_REMOVE;
|
||||||
if (win.get_maximized())
|
if (win.is_maximized())
|
||||||
win.unmaximize(Meta.MaximizeFlags.BOTH);
|
win.unmaximize();
|
||||||
|
|
||||||
const monitorIndex = win.get_monitor();
|
const monitorIndex = win.get_monitor();
|
||||||
const workspace = this._workspaceManager.get_active_workspace();
|
const workspace = this._workspaceManager.get_active_workspace();
|
||||||
@@ -558,7 +558,7 @@ class Tiler {
|
|||||||
height: workArea.height - 2 * this._outerGapVertical,
|
height: workArea.height - 2 * this._outerGapVertical,
|
||||||
};
|
};
|
||||||
windowsToTile.forEach((win) => {
|
windowsToTile.forEach((win) => {
|
||||||
if (win.get_maximized()) win.unmaximize(Meta.MaximizeFlags.BOTH);
|
if (win.is_maximized()) win.unmaximize();
|
||||||
});
|
});
|
||||||
if (windowsToTile.length === 1) {
|
if (windowsToTile.length === 1) {
|
||||||
windowsToTile[0].move_resize_frame(
|
windowsToTile[0].move_resize_frame(
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
// Simple-Tiling – MODERN MENU (GNOME Shell 45+) //
|
||||||
|
// © 2025 domoel – MIT //
|
||||||
|
///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ── GLOBAL IMPORTS ────────────────────────────────────────
|
||||||
|
import Adw from 'gi://Adw';
|
||||||
|
import Gio from 'gi://Gio';
|
||||||
|
import Gtk from 'gi://Gtk';
|
||||||
|
import GLib from 'gi://GLib';
|
||||||
|
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||||
|
|
||||||
|
export default class SimpleTilingPrefs extends ExtensionPreferences {
|
||||||
|
fillPreferencesWindow(window) {
|
||||||
|
const settings = this.getSettings();
|
||||||
|
const page = new Adw.PreferencesPage();
|
||||||
|
window.add(page);
|
||||||
|
|
||||||
|
// ── WINDOW GAPS ────────────────────────────────────────────
|
||||||
|
const groupGaps = new Adw.PreferencesGroup({
|
||||||
|
title: 'Window Gaps',
|
||||||
|
description: 'Adjust spacing between windows and screen edges.'
|
||||||
|
});
|
||||||
|
page.add(groupGaps);
|
||||||
|
|
||||||
|
const rowInnerGap = new Adw.SpinRow({
|
||||||
|
title: 'Inner Gap',
|
||||||
|
subtitle: 'Space between tiled windows (pixels)',
|
||||||
|
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
|
||||||
|
});
|
||||||
|
groupGaps.add(rowInnerGap);
|
||||||
|
settings.bind('inner-gap', rowInnerGap, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
|
||||||
|
const rowOuterH = new Adw.SpinRow({
|
||||||
|
title: 'Outer Gap (horizontal)',
|
||||||
|
subtitle: 'Left / right screen edges (pixels)',
|
||||||
|
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
|
||||||
|
});
|
||||||
|
groupGaps.add(rowOuterH);
|
||||||
|
settings.bind('outer-gap-horizontal', rowOuterH, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
|
||||||
|
const rowOuterV = new Adw.SpinRow({
|
||||||
|
title: 'Outer Gap (vertical)',
|
||||||
|
subtitle: 'Top / bottom screen edges (pixels)',
|
||||||
|
adjustment: new Gtk.Adjustment({ lower: 0, upper: 100, step_increment: 1 }),
|
||||||
|
});
|
||||||
|
groupGaps.add(rowOuterV);
|
||||||
|
settings.bind('outer-gap-vertical', rowOuterV, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
|
||||||
|
// ── WINDOW BEHAVIOR ────────────────────────────────────────────
|
||||||
|
const groupBehavior = new Adw.PreferencesGroup({ title: 'Window Behavior' });
|
||||||
|
page.add(groupBehavior);
|
||||||
|
|
||||||
|
const rowNewWindow = new Adw.ComboRow({
|
||||||
|
title: 'Open new windows as',
|
||||||
|
subtitle: 'Whether a new window starts as Master or Stack',
|
||||||
|
model: new Gtk.StringList({
|
||||||
|
strings: ['Stack Window (Default)', 'Master Window'],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
groupBehavior.add(rowNewWindow);
|
||||||
|
|
||||||
|
const currentBehavior = settings.get_string('new-window-behavior');
|
||||||
|
rowNewWindow.selected = currentBehavior === 'master' ? 1 : 0;
|
||||||
|
|
||||||
|
rowNewWindow.connect('notify::selected', () => {
|
||||||
|
const newVal = rowNewWindow.selected === 1 ? 'master' : 'stack';
|
||||||
|
settings.set_string('new-window-behavior', newVal);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ── KEYBINDINGS ────────────────────────────────────────────
|
||||||
|
const groupKeys = new Adw.PreferencesGroup({ title: 'Keybindings' });
|
||||||
|
page.add(groupKeys);
|
||||||
|
|
||||||
|
const rowKeys = new Adw.ActionRow({
|
||||||
|
title: 'Configure Shortcuts',
|
||||||
|
subtitle: 'Adjust all shortcuts in GNOME Keyboard settings.',
|
||||||
|
});
|
||||||
|
groupKeys.add(rowKeys);
|
||||||
|
|
||||||
|
const btnOpenKeyboard = new Gtk.Button({ label: 'Open Keyboard Settings' });
|
||||||
|
btnOpenKeyboard.connect('clicked', () => {
|
||||||
|
const appInfo = Gio.AppInfo.create_from_commandline(
|
||||||
|
'gnome-control-center keyboard', null, Gio.AppInfoCreateFlags.NONE
|
||||||
|
);
|
||||||
|
appInfo.launch([], null);
|
||||||
|
});
|
||||||
|
rowKeys.add_suffix(btnOpenKeyboard);
|
||||||
|
rowKeys.set_activatable_widget(btnOpenKeyboard);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// Simple-Tiling – MODERN MENU (GNOME Shell 45+) //
|
// Simple-Tiling – MODERN MENU (GNOME Shell 49+) //
|
||||||
// © 2025 domoel – MIT //
|
// © 2025 domoel – MIT //
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user