[gtk+] notebook: Include arrow size in tab size computation



commit 975f735fb779ef87416d7f64d1149c0ce0c521a2
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 1 17:45:14 2011 +0200

    notebook: Include arrow size in tab size computation
    
    We don't want tabs to resize when a 2nd page is added, just because the
    scroll arrows are now visible. And we do want the arrow size to be
    included.
    
    Note: Previosuly this code was never run, as the check
      requisition->width < tab_width
    was only run when tab_width wasn't computed, so was still equal to 0
    (same for the height). So what this patch essentially does it add the
    functionality of the if switch.

 gtk/gtknotebook.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 77e8a47..ad9412f 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2113,8 +2113,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                   if (tab_height == 0)
                     break;
 
-                  if (priv->scrollable && vis_pages > 1 &&
-                      requisition->width < tab_width)
+                  if (priv->scrollable)
                     tab_height = MAX (tab_height, scroll_arrow_hlength);
 
                   tab_height = MAX (tab_height, action_widget_requisition[ACTION_WIDGET_START].height);
@@ -2160,10 +2159,8 @@ gtk_notebook_size_request (GtkWidget      *widget,
                   if (tab_width == 0)
                     break;
 
-                  if (priv->scrollable && vis_pages > 1 &&
-                      requisition->height < tab_height)
-                    tab_width = MAX (tab_width,
-                                     arrow_spacing + 2 * scroll_arrow_vlength);
+                  if (priv->scrollable)
+                    tab_width = MAX (tab_width, arrow_spacing + 2 * scroll_arrow_vlength);
 
                   tab_width = MAX (tab_width, action_widget_requisition[ACTION_WIDGET_START].width);
                   tab_width = MAX (tab_width, action_widget_requisition[ACTION_WIDGET_END].width);



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