[polari] mainWindow: Hide user-list while on selection-mode



commit 65513b22ae15913eb394efa5d9259f3708a1692e
Author: Felipe Borges <felipe10borges gmail com>
Date:   Mon Oct 14 09:58:47 2013 -0300

    mainWindow: Hide user-list while on selection-mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709395

 data/resources/main-window.ui |    2 +-
 src/mainWindow.js             |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index 7ad48a0..f1a5db4 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -115,7 +115,7 @@
               </object>
             </child>
             <child>
-              <object class="GtkToggleButton" id="button3">
+              <object class="GtkToggleButton" id="show_user_list_button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="focus_on_click">False</property>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 0c3d1ad..d997cbd 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -65,6 +65,7 @@ const MainWindow = new Lang.Class({
         this._titlebarLeft = builder.get_object('titlebar_left');
 
         this._selectionRevealer = builder.get_object('selection_toolbar_revealer');
+        this._showUserListButton = builder.get_object('show_user_list_button');
         this._revealer = builder.get_object('room_list_revealer');
         this._chatStack = builder.get_object('chat_stack');
         this._inputArea = builder.get_object('main_input_area');
@@ -90,6 +91,8 @@ const MainWindow = new Lang.Class({
         this._selectionModeAction.connect('notify::state',
                     Lang.bind(this, this._onSelectionModeChanged));
 
+        this._userListAction = app.lookup_action('user-list');
+
         this._entry.connect('activate', Lang.bind(this,
             function() {
                 this._ircParser.process(this._entry.text);
@@ -220,6 +223,8 @@ const MainWindow = new Lang.Class({
     _onSelectionModeChanged: function() {
         let enabled = this._selectionModeAction.state.get_boolean();
         this._selectionRevealer.reveal_child = enabled;
+        this._showUserListButton.visible = !enabled;
+        this._userListAction.enabled = !enabled;
 
         if (enabled) {
             this._titlebarLeft.get_style_context().add_class('selection-mode');


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