MessageTray: fix notification height expansion

MessageTray._tween removes all tweens now, so it removes also
those setting the height to expanded for critical notifications.

This is a regression from 1a27d7dfc0

https://bugzilla.gnome.org/show_bug.cgi?id=689295
This commit is contained in:
Giovanni Campagna 2012-11-30 16:05:38 +01:00
parent d4dc1c87c5
commit 41f933b89e

View File

@ -2263,40 +2263,28 @@ const MessageTray = new Lang.Class({
_updateShowingNotification: function() { _updateShowingNotification: function() {
this._notification.acknowledged = true; this._notification.acknowledged = true;
Tweener.removeTweens(this._notificationWidget);
// We auto-expand notifications with CRITICAL urgency. // We auto-expand notifications with CRITICAL urgency.
// We use Tweener.removeTweens() to remove a tween that was hiding the notification we are if (this._notification.urgency == Urgency.CRITICAL)
// updating, in case that notification was in the process of being hidden. However,
// Tweener.removeTweens() would also remove a tween that was updating the position of the
// notification we are updating, in case that notification was already expanded and its height
// changed. Therefore we need to call this._expandNotification() for expanded notifications
// to make sure their position is updated.
if (this._notification.urgency == Urgency.CRITICAL || this._notification.expanded)
this._expandNotification(true); this._expandNotification(true);
// We tween all notifications to full opacity. This ensures that both new notifications and // We tween all notifications to full opacity. This ensures that both new notifications and
// notifications that might have been in the process of hiding get full opacity. // notifications that might have been in the process of hiding get full opacity.
// //
// We tween any notification showing in the banner mode to banner height // We tween any notification showing in the banner mode to the appropriate height
// (this._notificationWidget.y = -this._notificationWidget.height). // (which is banner height or expanded height, depending on the notification state)
// This ensures that both new notifications and notifications in the banner mode that might // This ensures that both new notifications and notifications in the banner mode that might
// have been in the process of hiding are shown with the banner height. // have been in the process of hiding are shown with the correct height.
// //
// We use this._showNotificationCompleted() onComplete callback to extend the time the updated // We use this._showNotificationCompleted() onComplete callback to extend the time the updated
// notification is being shown. // notification is being shown.
//
// We don't set the y parameter for the tween for expanded notifications because
// this._expandNotification() will result in getting this._notificationWidget.y set to the appropriate
// fully expanded value.
let tweenParams = { opacity: 255, let tweenParams = { opacity: 255,
y: -this._notificationWidget.height,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: this._showNotificationCompleted, onComplete: this._showNotificationCompleted,
onCompleteScope: this onCompleteScope: this
}; };
if (!this._notification.expanded)
tweenParams.y = -this._notificationWidget.height;
this._tween(this._notificationWidget, '_notificationState', State.SHOWN, tweenParams); this._tween(this._notificationWidget, '_notificationState', State.SHOWN, tweenParams);
}, },