diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-10 13:32:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-10 14:44:01 +0000 |
commit | 2705a55fe1128387a1761cae93b1e41ebaeb750d (patch) | |
tree | 87178c5463e34efb0b3847e0559011ec7d49d8e2 /extensions/vertical-workspaces/lib/osdWindow.js | |
parent | Adding upstream version 20230618. (diff) | |
download | gnome-shell-extensions-extra-2705a55fe1128387a1761cae93b1e41ebaeb750d.tar.xz gnome-shell-extensions-extra-2705a55fe1128387a1761cae93b1e41ebaeb750d.zip |
Adding upstream version 20231210.upstream/20231012
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extensions/vertical-workspaces/lib/osdWindow.js')
-rw-r--r-- | extensions/vertical-workspaces/lib/osdWindow.js | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/extensions/vertical-workspaces/lib/osdWindow.js b/extensions/vertical-workspaces/lib/osdWindow.js deleted file mode 100644 index a010558..0000000 --- a/extensions/vertical-workspaces/lib/osdWindow.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * V-Shell (Vertical Workspaces) - * osdWindow.js - * - * @author GdH <G-dH@github.com> - * @copyright 2022 - 2023 - * @license GPL-3.0 - * - */ - -'use strict'; - -const { Clutter } = imports.gi; -const Main = imports.ui.main; -const OsdWindow = imports.ui.osdWindow; - -const Me = imports.misc.extensionUtils.getCurrentExtension(); -const _Util = Me.imports.lib.util; - -const OsdPositions = { - 1: { - x_align: Clutter.ActorAlign.START, - y_align: Clutter.ActorAlign.START, - }, - 2: { - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.START, - }, - 3: { - x_align: Clutter.ActorAlign.END, - y_align: Clutter.ActorAlign.START, - }, - 4: { - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.CENTER, - }, - 5: { - x_align: Clutter.ActorAlign.START, - y_align: Clutter.ActorAlign.END, - }, - 6: { - x_align: Clutter.ActorAlign.CENTER, - y_align: Clutter.ActorAlign.END, - }, - 7: { - x_align: Clutter.ActorAlign.END, - y_align: Clutter.ActorAlign.END, - }, -}; - -let _overrides; -let opt; -let _firstRun = true; - -function update(reset = false) { - opt = Me.imports.lib.settings.opt; - const moduleEnabled = opt.get('osdWindowModule', true); - reset = reset || !moduleEnabled; - - // don't even touch this module if disabled - if (_firstRun && reset) - return; - - _firstRun = false; - - if (_overrides) - _overrides.removeAll(); - - if (reset || !moduleEnabled) { - updateExistingOsdWindows(6); - _overrides = null; - opt = null; - return; - } - - _overrides = new _Util.Overrides(); - _overrides.addOverride('osdWindow', OsdWindow.OsdWindow.prototype, OsdWindowCommon); -} - -function updateExistingOsdWindows(position) { - position = position ? position : opt.OSD_POSITION; - Main.osdWindowManager._osdWindows.forEach(osd => { - osd.set(OsdPositions[position]); - }); -} - -const OsdWindowCommon = { - after_show() { - if (!opt.OSD_POSITION) - this.opacity = 0; - this.set(OsdPositions[opt.OSD_POSITION]); - }, -}; |