[polari/user-list-update: 5/5] userList: Don't animate sidebar and filter entry at the same time



commit 6836309073814b49c30dcc9efc942cc7af99fca0
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 4 22:07:31 2013 +0200

    userList: Don't animate sidebar and filter entry at the same time
    
    It just looks weird - in case the user list was hidden, we should
    show or hide the filter entry without animation before revealing
    the sidebar.

 src/mainWindow.js |    4 ++++
 src/userList.js   |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index c0cccf5..46ecb5a 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -85,6 +85,10 @@ const MainWindow = new Lang.Class({
             function(group, actionName, value) {
                 revealer.reveal_child = value.get_boolean();
             }));
+        revealer.connect('notify::child-revealed', Lang.bind(this,
+            function() {
+                this._userListSidebar.animateEntry = revealer.child_revealed;
+            }));
 
         this._selectionModeAction = app.lookup_action('selection-mode');
         this._selectionModeAction.connect('notify::state',
diff --git a/src/userList.js b/src/userList.js
index 51e43bc..398b419 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -26,6 +26,10 @@ const UserListSidebar = new Lang.Class({
                                   Lang.bind(this, this._activeRoomChanged));
     },
 
+    set animateEntry(animate) {
+        this._revealer.transition_duration = animate ? 250 : 0;
+    },
+
     _createWidget: function() {
         this.widget = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
 


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