[gnome-shell] Remove unused button width and height arguments and specify button height explicitly



commit babb13f6035240e402ecda3a946ea4c69d0e4470
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date:   Tue Aug 11 18:10:25 2009 -0400

    Remove unused button width and height arguments and specify button height explicitly
    
    minWidth and minHeight arguments of the Button class were not used.
    
    Panel buttons need their height to be explicitly specified as
    PANEL_HEIGHT to take up full panel height. This fixes the problem with the
    user not being able to click at the very top edge of the panel to activate
    the button.

 js/ui/button.js |   14 +++-----------
 js/ui/panel.js  |    6 ++++--
 2 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/button.js b/js/ui/button.js
index 60d1d8c..6ac9649 100644
--- a/js/ui/button.js
+++ b/js/ui/button.js
@@ -22,12 +22,12 @@ const DEFAULT_FONT = 'Sans Bold 16px';
 // Padding on the left and right side of the button.
 const SIDE_PADDING = 14;
 
-function Button(widget, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font) {
-    this._init(widget, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font);
+function Button(widget, buttonColor, pressedButtonColor, textColor, staysPressed, font) {
+    this._init(widget, buttonColor, pressedButtonColor, textColor, staysPressed, font);
 }
 
 Button.prototype = {
-    _init : function(widgetOrText, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font) {
+    _init : function(widgetOrText, buttonColor, pressedButtonColor, textColor, staysPressed, font) {
         let me = this;
 
         this._buttonColor = buttonColor
@@ -50,11 +50,6 @@ Button.prototype = {
         if (font == null)
             this._font = DEFAULT_FONT;
 
-        if (minWidth == null)
-            minWidth = 0;
-        if (minHeight == null)
-            minHeight = 0;
-
         // if this._staysPressed is true, this._active will be true past the first release of a button, until a subsequent one (the button
         // is unpressed) or until release() is called explicitly
         this._active = false;
@@ -78,9 +73,6 @@ Button.prototype = {
 
         this.button.append(this._widget, Big.BoxPackFlags.EXPAND);
 
-        this._minWidth = minWidth;
-        this._minHeight = minHeight;
-
         this.button.connect('button-press-event',
             function(o, event) {
                 me._isBetweenPressAndRelease = true;
diff --git a/js/ui/panel.js b/js/ui/panel.js
index dda10ab..fa9d6d0 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -252,7 +252,8 @@ Panel.prototype = {
         /* left side */
 
         this.button = new Button.Button("Activities", PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
-                                        PANEL_FOREGROUND_COLOR, true, null, PANEL_HEIGHT, DEFAULT_FONT);
+                                        PANEL_FOREGROUND_COLOR, true, DEFAULT_FONT);
+        this.button.button.height = PANEL_HEIGHT;
 
         this._leftBox.append(this.button.button, Big.BoxPackFlags.NONE);
 
@@ -336,7 +337,8 @@ Panel.prototype = {
                                              PANEL_BUTTON_COLOR,
                                              PRESSED_BUTTON_BACKGROUND_COLOR,
                                              PANEL_FOREGROUND_COLOR,
-                                             true, null, PANEL_HEIGHT);
+                                             true);
+        statusbutton.button.height = PANEL_HEIGHT;
         statusbutton.button.connect('button-press-event', function (b, e) {
             statusmenu.toggle(e);
             return false;



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