[gnome-shell] messageTray: Don't animate notifications if they've shrunk.



commit 0ae1556b9483f7f700128eab4c50232cb0102b8b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon May 23 17:15:08 2011 -0400

    messageTray: Don't animate notifications if they've shrunk.
    
    The effect of the large gap breaks the illusion of the message attached to
    the bottom of the screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641570

 js/ui/messageTray.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 8c7dbf8..5c57c9c 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2011,9 +2011,15 @@ MessageTray.prototype = {
         this._notification.expand(!autoExpanding);
     },
 
-   _onNotificationExpanded: function() {
+    _onNotificationExpanded: function() {
         let expandedY = this.actor.height - this._notificationBin.height;
-        if (this._notificationBin.y != expandedY)
+
+        // Don't animate the notification to its new position if it has shrunk:
+        // there will be a very visible "gap" that breaks the illusion.
+
+        if (this._notificationBin.y < expandedY)
+            this._notificationBin.y = expandedY;
+        else if (this._notification.y != expandedY)
             this._tween(this._notificationBin, '_notificationState', State.SHOWN,
                         { y: expandedY,
                           time: ANIMATION_TIME,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]