[polari/gnome-3-16] mainWindow: Fix min-width of user-list button



commit b9ca8376053d38b4dc5054132229b0c2f8f89f27
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 31 18:56:28 2015 +0200

    mainWindow: Fix min-width of user-list button
    
    We currently set a width-request in the .ui file that used to be
    consistent with the width of icon buttons, but the (default) theme
    changed at one point, so this is no longer the case.
    Fix this by setting the width-request to the actually allocated width
    of an actual icon button (the join-menu).

 data/resources/main-window.ui |    2 --
 src/mainWindow.js             |    6 ++++++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index 21dbc2b..f4fade2 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -162,8 +162,6 @@
                 <property name="can_focus">True</property>
                 <property name="focus_on_click">False</property>
                 <property name="action_name">app.user-list</property>
-                <!-- be at least as wide as icon buttons - 16px + padding -->
-                <property name="width-request">32</property>
                 <style>
                   <class name="polari-user-list-button"/>
                   <class name="text-button"/>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 6e6ad86..a2dec37 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -220,6 +220,12 @@ const MainWindow = new Lang.Class({
         this._showUserListButton = builder.get_object('show_user_list_button');
         this._revealer = builder.get_object('room_list_revealer');
 
+        // Make sure user-list button is at least as wide as icon buttons
+        this._joinMenuButton.connect('size-allocate', Lang.bind(this,
+            function(w, rect) {
+                this._showUserListButton.width_request = rect.width;
+            }));
+
         let scroll = builder.get_object('room_list_scrollview');
         this._roomList = new RoomList.RoomList();
         scroll.add(this._roomList.widget);


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