[polari] Change condition for enabling room list and selection mode switch



commit a9fefbb99ce491f3b47a869384b0b51b1efc61ae
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Oct 6 23:56:52 2013 +0200

    Change condition for enabling room list and selection mode switch
    
    We currently disable those when the number of rooms drops to 0,
    however as leaving a room can take a while, we hide rooms we are
    leaving immediately to not feel sluggish - as a result, the room
    list may remain empty for a while before it is hidden.
    Adjust the condition to avoid this disconnect.

 src/application.js |    2 +-
 src/mainWindow.js  |    5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 661a597..db959d9 100644
--- a/src/application.js
+++ b/src/application.js
@@ -209,7 +209,7 @@ const Application = new Lang.Class({
     },
 
     _updateSelectionModeAction: function(action) {
-        action.enabled = this._chatroomManager.roomCount > 0;
+        action.enabled = this._chatroomManager.getActiveRoom() != null;
     },
 
     _selectionModeHook: function(action) {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index d784922..d196e02 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -248,15 +248,11 @@ const MainWindow = new Lang.Class({
 
         this._userListStack.add_named(userList.widget, room.id);
         this._chatStack.add_named(chatView.widget, room.id);
-
-        this._revealer.reveal_child = roomManager.roomCount > 0;
     },
 
     _roomRemoved: function(roomManager, room) {
         this._rooms[room.id].forEach(function(w) { w.widget.destroy(); });
         delete this._rooms[room.id];
-
-        this._revealer.reveal_child = roomManager.roomCount > 0;
     },
 
     _activeRoomChanged: function(manager, room) {
@@ -270,6 +266,7 @@ const MainWindow = new Lang.Class({
         this._nicknameChangedId = 0;
 
         this._room = room;
+        this._revealer.reveal_child = room != null;
 
         this._updateTitlebar();
         this._updateNick();


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