diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:02:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:02:14 +0000 |
commit | 52f118cd4c2fbdd81a6ef463835a20cb3d6a3667 (patch) | |
tree | 0904907fa04c7c1fe36fe8cdefab7e27b477723a /extensions/vertical-workspaces/lib/messageTray.js | |
parent | Updating multi-monitors-add-on to version 26 [d8ea040]. (diff) | |
download | gnome-shell-extensions-extra-52f118cd4c2fbdd81a6ef463835a20cb3d6a3667.tar.xz gnome-shell-extensions-extra-52f118cd4c2fbdd81a6ef463835a20cb3d6a3667.zip |
Updating vertical-workspaces to version 28 [891a8df].
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | extensions/vertical-workspaces/lib/messageTray.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/extensions/vertical-workspaces/lib/messageTray.js b/extensions/vertical-workspaces/lib/messageTray.js new file mode 100644 index 0000000..b35541a --- /dev/null +++ b/extensions/vertical-workspaces/lib/messageTray.js @@ -0,0 +1,67 @@ +/** + * V-Shell (Vertical Workspaces) + * messageTray.js + * + * @author GdH <G-dH@github.com> + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const { Clutter } = imports.gi; +const Me = imports.misc.extensionUtils.getCurrentExtension(); +const Main = imports.ui.main; + +let opt; +let _firstRun = true; + +function update(reset = false) { + opt = Me.imports.lib.settings.opt; + const moduleEnabled = opt.get('messageTrayModule', true); + reset = reset || !moduleEnabled; + + // don't even touch this module if disabled + if (_firstRun && reset) + return; + + _firstRun = false; + + if (reset) { + opt = null; + setNotificationPosition(1); + return; + } + + setNotificationPosition(opt.NOTIFICATION_POSITION); +} + +function setNotificationPosition(position) { + switch (position) { + case 0: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.START; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.START; + break; + case 1: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.CENTER; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.START; + break; + case 2: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.END; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.START; + break; + case 3: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.START; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.END; + break; + case 4: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.CENTER; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.END; + break; + case 5: + Main.messageTray._bannerBin.x_align = Clutter.ActorAlign.END; + Main.messageTray._bannerBin.y_align = Clutter.ActorAlign.END; + break; + } +} |