From 975f735fb779ef87416d7f64d1149c0ce0c521a2 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 1 Jun 2011 17:45:14 +0200 Subject: [PATCH] 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 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 77e8a47f7b..ad9412ff55 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);