From 539b8ae9f6244b57d614200d8dd64044b431eb4a Mon Sep 17 00:00:00 2001 From: Marina Zhurakhinskaya Date: Sun, 29 Aug 2010 00:04:33 -0400 Subject: [PATCH] Don't show the banner when hiding the notification or showing it in the summary mode The banner should not be appearing briefly when we are hiding the notification. For that, we should only restore the opacity of the banner in popInCompleted() when we are done hiding the notification. We do need to restore the opacity in case the notification is updated and is shown in the banner mode again. The banner should not be appearing briefly when we are showing the notification in the summary mode. For that, we should not use the animation time to fade out the banner in popOut() for summary notifications. These two problems were particularly visible when the ANIMATION_TIME was increased. https://bugzilla.gnome.org/show_bug.cgi?id=623970 --- js/ui/messageTray.js | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index d5aad65d2..b6545cd61 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -379,26 +379,23 @@ Notification.prototype = { })); }, - popOut: function() { + popOut: function(animate) { if (this.actor.row_count <= 1) return false; - Tweener.addTween(this._bannerLabel, - { opacity: 0, - time: ANIMATION_TIME, - transition: 'easeOutQuad' }); + if (animate) + Tweener.addTween(this._bannerLabel, + { opacity: 0, + time: ANIMATION_TIME, + transition: 'easeOutQuad' }); + else + this._bannerLabel.opacity = 0; + return true; }, - popIn: function() { - if (this.actor.row_count <= 1) - return false; - - Tweener.addTween(this._bannerLabel, - { opacity: 255, - time: ANIMATION_TIME, - transition: 'easeOutQuad' }); - return true; + popInCompleted: function() { + this._bannerLabel.opacity = 255; }, grabFocus: function(lockTray) { @@ -1241,7 +1238,6 @@ MessageTray.prototype = { _hideNotification: function() { this._notification.ungrabFocus(); - this._notification.popIn(); if (this._reExpandNotificationId) { this._notificationBin.disconnect(this._reExpandNotificationId); @@ -1262,11 +1258,12 @@ MessageTray.prototype = { this._notificationRemoved = false; this._notificationBin.hide(); this._notificationBin.child = null; + this._notification.popInCompleted(); this._notification = null; }, _expandNotification: function() { - if (this._notification && this._notification.popOut()) { + if (this._notification && this._notification.popOut(true)) { // Don't grab focus in urgent notifications that are auto-expanded. if (!this._notification.urgent) this._notification.grabFocus(false); @@ -1335,7 +1332,7 @@ MessageTray.prototype = { this._notificationQueue.splice(index, 1); this._summaryNotificationBin.child = this._summaryNotification.actor; - this._summaryNotification.popOut(); + this._summaryNotification.popOut(false); this._summaryNotification.grabFocus(true); this._summaryNotificationBin.opacity = 0; @@ -1366,7 +1363,6 @@ MessageTray.prototype = { if (this._summaryState != State.SHOWN) this._clickedSummaryItem = null; this._summaryNotification.ungrabFocus(); - this._summaryNotification.popIn(); this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.HIDDEN, { y: this.actor.height, @@ -1386,6 +1382,7 @@ MessageTray.prototype = { _hideSummaryNotificationCompleted: function() { this._summaryNotificationBin.hide(); this._summaryNotificationBin.child = null; + this._summaryNotification.popInCompleted(); this._summaryNotification = null; } };