Moving current extensions to subdirectory for GNOME 44 as GNOME Shell 45 is backwards incompatible (see Debian #1052112).
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b42bc882b7
commit
c2040beebc
138 changed files with 4 additions and 1 deletions
67
extensions/44/vertical-workspaces/lib/messageTray.js
Normal file
67
extensions/44/vertical-workspaces/lib/messageTray.js
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue