[gnome] Update extensions

This commit is contained in:
2024-10-31 10:19:02 -04:00
parent 851ec4a772
commit 6d1e6d1132
238 changed files with 8705 additions and 4185 deletions

View File

@ -1,11 +1,22 @@
import Shell from 'gi://Shell';
import Clutter from 'gi://Clutter';
import Cogl from 'gi://Cogl';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import { adjustAnimationTime } from 'resource:///org/gnome/shell/misc/animationUtils.js';
import { PaintSignals } from '../effects/paint_signals.js';
import { PaintSignals } from '../conveniences/paint_signals.js';
// TODO drop Tweener in favour of Clutter's `ease` (will need to extend the blur effect for it)
const Tweener = imports.tweener.tweener;
const transparent = Clutter.Color.from_pixel(0x00000000);
// TODO: Drop GNOME 46 backwards compatibility
const transparent = Clutter.Color ?
Clutter.Color.from_pixel(0x00000000) :
new Cogl.Color({
red: 0,
green: 0,
blue: 0,
alpha: 0
});
const FOLDER_DIALOG_ANIMATION_TIME = 200;
const DIALOGS_STYLES = [
@ -43,7 +54,7 @@ let _zoomAndFadeIn = function () {
{
radius: sigma * 2,
brightness: brightness,
time: FOLDER_DIALOG_ANIMATION_TIME / 1000,
time: adjustAnimationTime(FOLDER_DIALOG_ANIMATION_TIME / 1000),
transition: 'easeOutQuad'
}
);
@ -87,7 +98,7 @@ let _zoomAndFadeOut = function () {
{
radius: 0,
brightness: 1.0,
time: FOLDER_DIALOG_ANIMATION_TIME / 1000,
time: adjustAnimationTime(FOLDER_DIALOG_ANIMATION_TIME / 1000),
transition: 'easeInQuad'
}
);
@ -120,6 +131,8 @@ let _zoomAndFadeOut = function () {
export const AppFoldersBlur = class AppFoldersBlur {
// we do not use the effects manager and dummy pipelines here because we
// really want to manage our sigma value ourself during the transition
constructor(connections, settings, _) {
this.connections = connections;
this.paint_signals = new PaintSignals(connections);
@ -129,12 +142,8 @@ export const AppFoldersBlur = class AppFoldersBlur {
enable() {
this._log("blurring appfolders");
brightness = this.settings.appfolder.CUSTOMIZE
? this.settings.appfolder.BRIGHTNESS
: this.settings.BRIGHTNESS;
sigma = this.settings.appfolder.CUSTOMIZE
? this.settings.appfolder.SIGMA
: this.settings.SIGMA;
brightness = this.settings.appfolder.BRIGHTNESS;
sigma = this.settings.appfolder.SIGMA;
let appDisplay = Main.overview._overview.controls._appDisplay;
@ -143,15 +152,15 @@ export const AppFoldersBlur = class AppFoldersBlur {
}
this.connections.connect(
appDisplay, 'view-loaded', this.blur_appfolders.bind(this)
appDisplay, 'view-loaded', _ => this.blur_appfolders()
);
}
blur_appfolders() {
let appDisplay = Main.overview._overview.controls._appDisplay;
if (this.settings.HACKS_LEVEL === 1 || this.settings.HACKS_LEVEL === 2)
this._log(`appfolders hack level ${this.settings.HACKS_LEVEL}`);
if (this.settings.HACKS_LEVEL === 1)
this._log("appfolders hack level 1");
appDisplay._folderIcons.forEach(icon => {
icon._ensureFolderDialog();
@ -197,7 +206,7 @@ export const AppFoldersBlur = class AppFoldersBlur {
//
// [1]: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2857
if (this.settings.HACKS_LEVEL === 1 || this.settings.HACKS_LEVEL === 2) {
if (this.settings.HACKS_LEVEL === 1) {
this.paint_signals.disconnect_all_for_actor(icon._dialog);
this.paint_signals.connect(icon._dialog, blur_effect);
} else {
@ -218,11 +227,6 @@ export const AppFoldersBlur = class AppFoldersBlur {
this.blur_appfolders();
}
// not implemented for dynamic blur
set_color(c) { }
set_noise_amount(n) { }
set_noise_lightness(l) { }
disable() {
this._log("removing blur from appfolders");