mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
messageTray: Use duration 0 when not animating
Instead of using a special branch for the not animate case, just use
the same path with duration 0.
Since commit ee09c5c853 we are sure that
duration 0 is always preserved.
In the not animate case, we now call this._updateState(). This was not
happening before.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2987>
This commit is contained in:
parent
be49c8efc2
commit
1571171a21
1 changed files with 17 additions and 23 deletions
|
|
@ -1356,29 +1356,23 @@ export const MessageTray = GObject.registerClass({
|
|||
this._resetNotificationLeftTimeout();
|
||||
this._bannerBin.remove_all_transitions();
|
||||
|
||||
if (animate) {
|
||||
this._notificationState = State.HIDING;
|
||||
this._bannerBin.ease({
|
||||
opacity: 0,
|
||||
duration: ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_BACK,
|
||||
});
|
||||
this._bannerBin.ease({
|
||||
y: -this._bannerBin.height,
|
||||
duration: ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_BACK,
|
||||
onComplete: () => {
|
||||
this._notificationState = State.HIDDEN;
|
||||
this._hideNotificationCompleted();
|
||||
this._updateState();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this._bannerBin.y = -this._bannerBin.height;
|
||||
this._bannerBin.opacity = 0;
|
||||
this._notificationState = State.HIDDEN;
|
||||
this._hideNotificationCompleted();
|
||||
}
|
||||
const duration = animate ? ANIMATION_TIME : 0;
|
||||
this._notificationState = State.HIDING;
|
||||
this._bannerBin.ease({
|
||||
opacity: 0,
|
||||
duration,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_BACK,
|
||||
});
|
||||
this._bannerBin.ease({
|
||||
y: -this._bannerBin.height,
|
||||
duration,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_BACK,
|
||||
onComplete: () => {
|
||||
this._notificationState = State.HIDDEN;
|
||||
this._hideNotificationCompleted();
|
||||
this._updateState();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
_hideNotificationCompleted() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue