Updating vertical-workspaces to version 28 [891a8df].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
9040b41006
commit
4b671643c1
49 changed files with 10937 additions and 3948 deletions
61
extensions/vertical-workspaces/lib/appFavorites.js
Normal file
61
extensions/vertical-workspaces/lib/appFavorites.js
Normal file
|
@ -0,0 +1,61 @@
|
|||
/**
|
||||
* V-Shell (Vertical Workspaces)
|
||||
* appFavorites.js
|
||||
*
|
||||
* @author GdH <G-dH@github.com>
|
||||
* @copyright 2022 - 2023
|
||||
* @license GPL-3.0
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const { Shell } = imports.gi;
|
||||
const AppFavorites = imports.ui.appFavorites;
|
||||
const Main = imports.ui.main;
|
||||
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
const _Util = Me.imports.lib.util;
|
||||
|
||||
let opt;
|
||||
let _overrides;
|
||||
let _firstRun = true;
|
||||
|
||||
function update(reset = false) {
|
||||
opt = Me.imports.lib.settings.opt;
|
||||
const moduleEnabled = opt.get('appFavoritesModule', true);
|
||||
reset = reset || !moduleEnabled;
|
||||
|
||||
// don't even touch this module if disabled
|
||||
if (_firstRun && reset)
|
||||
return;
|
||||
|
||||
_firstRun = false;
|
||||
|
||||
if (_overrides)
|
||||
_overrides.removeAll();
|
||||
|
||||
|
||||
// if notifications are enabled no override is needed
|
||||
if (reset || opt.SHOW_FAV_NOTIFICATION) {
|
||||
_overrides = null;
|
||||
opt = null;
|
||||
return;
|
||||
}
|
||||
|
||||
_overrides = new _Util.Overrides();
|
||||
|
||||
// AppFavorites.AppFavorites is const, first access returns undefined
|
||||
const dummy = AppFavorites.AppFavorites;
|
||||
_overrides.addOverride('AppFavorites', AppFavorites.AppFavorites.prototype, AppFavoritesCommon);
|
||||
}
|
||||
|
||||
const AppFavoritesCommon = {
|
||||
addFavoriteAtPos(appId, pos) {
|
||||
this._addFavorite(appId, pos);
|
||||
},
|
||||
|
||||
removeFavorite(appId) {
|
||||
this._removeFavorite(appId);
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue