[Xfce4-commits] [xfce/xfce4-panel] 01/01: libxfce4panel: arrow button size fixes

noreply at xfce.org noreply at xfce.org
Thu Dec 6 00:01:10 CET 2018


This is an automated email from the git hooks/post-receive script.

a   n   d   r   z   e   j   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit ecf9bec4fa082e20b79ce037c5df7f7935e4396b
Author: Andrzej <andrzejr at xfce.org>
Date:   Wed Dec 5 23:01:02 2018 +0000

    libxfce4panel: arrow button size fixes
    
    Initialise button sizes not to return rubbish.
    Make minimum and natural sizes the same to prevent
    squeezing the buttons when panel runs out of space.
---
 libxfce4panel/xfce-arrow-button.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libxfce4panel/xfce-arrow-button.c b/libxfce4panel/xfce-arrow-button.c
index 6ebde43..f14c2e4 100644
--- a/libxfce4panel/xfce-arrow-button.c
+++ b/libxfce4panel/xfce-arrow-button.c
@@ -364,6 +364,7 @@ xfce_arrow_button_get_preferred_width (GtkWidget *widget,
   GtkStyleContext *context;
   GtkBorder        padding, border;
 
+  minimum_child_width = natural_child_width = 0;
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child != NULL
       && gtk_widget_get_visible (child))
@@ -389,8 +390,7 @@ xfce_arrow_button_get_preferred_width (GtkWidget *widget,
       context = gtk_widget_get_style_context (widget);
       gtk_style_context_get_padding (context, gtk_widget_get_state_flags (widget), &padding);
       gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget), &border);
-      natural_child_width = (ARROW_WIDTH + padding.left + padding.right + border.left + border.right);
-      minimum_child_width = natural_child_width - ARROW_WIDTH;
+      minimum_child_width = natural_child_width = (ARROW_WIDTH + padding.left + padding.right + border.left + border.right);
     }
 
   if (minimum_width != NULL)
@@ -413,6 +413,7 @@ xfce_arrow_button_get_preferred_height (GtkWidget *widget,
   GtkStyleContext *context;
   GtkBorder        padding, border;
 
+  minimum_child_height = natural_child_height = 0;
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child != NULL
       && gtk_widget_get_visible (child))
@@ -438,8 +439,7 @@ xfce_arrow_button_get_preferred_height (GtkWidget *widget,
       context = gtk_widget_get_style_context (widget);
       gtk_style_context_get_padding (context, gtk_widget_get_state_flags (widget), &padding);
       gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget), &border);
-      natural_child_height = (ARROW_WIDTH + padding.top + padding.bottom + border.top + border.bottom);
-      minimum_child_height = natural_child_height - ARROW_WIDTH;
+      minimum_child_height = natural_child_height = (ARROW_WIDTH + padding.top + padding.bottom + border.top + border.bottom);
     }
 
 
@@ -514,6 +514,7 @@ xfce_arrow_button_size_request (GtkWidget      *widget,
   XfceArrowButton *button = XFCE_ARROW_BUTTON (widget);
   GtkWidget *child;
 
+  requisition->height = requisition->width = 0;
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child != NULL && GTK_WIDGET_VISIBLE (child))
     {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list