Skip to content

Commit

Permalink
dialogs: Respect animation settings
Browse files Browse the repository at this point in the history
If desktop and window effects are disabled:

- don't use radial shaders
- don't animate the dialog

Fixes linuxmint/mint22.1-beta#24
  • Loading branch information
clefebvre committed Dec 19, 2024
1 parent 9489d12 commit 67bef86
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/ui/modalDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const Gettext = imports.gettext;

const FADE_OUT_DIALOG_TIME = 1000;

var OPEN_AND_CLOSE_TIME = 100;

var State = {
OPENED: 0,
CLOSED: 1,
Expand Down Expand Up @@ -108,10 +106,17 @@ var ModalDialog = GObject.registerClass({
this.contentLayout = this.dialogLayout.contentLayout;
this.buttonLayout = this.dialogLayout.buttonLayout;

this.open_and_close_time = 100;
let enable_radial_effect = true;
if (!global.settings.get_boolean("desktop-effects-workspace")) {
this.open_and_close_time = 0;
enable_radial_effect = false;
}

if (!this._cinnamonReactive) {
this._lightbox = new Lightbox.Lightbox(this,
{ inhibitEvents: true,
radialEffect: true });
radialEffect: enable_radial_effect });
this._lightbox.highlight(this._backgroundBin);

this._eventBlocker = new Clutter.Actor({ reactive: true });
Expand Down Expand Up @@ -198,7 +203,7 @@ var ModalDialog = GObject.registerClass({
this.show();
this.ease({
opacity: 255,
duration: OPEN_AND_CLOSE_TIME,
duration: this.open_and_close_time,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
this._setState(State.OPENED);
Expand Down Expand Up @@ -254,7 +259,7 @@ var ModalDialog = GObject.registerClass({

this.ease({
opacity: 0,
duration: OPEN_AND_CLOSE_TIME,
duration: this.open_and_close_time,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
this._setState(State.CLOSED);
Expand Down

0 comments on commit 67bef86

Please sign in to comment.