notebook: Compute tab width in a simpler way

This code should be more obvious: The check only needs to check for
scrollable widgets, and only needs to compare to tab_width.

As a side note, for vis_pages == 1, tab_width will be smaller than
tab_max + stuff, so this code will not behave differently.
This commit is contained in:
Benjamin Otte 2011-06-01 21:56:13 +02:00
parent 86aefc2c31
commit edd2f24b6e

View File

@ -2136,9 +2136,9 @@ gtk_notebook_size_request (GtkWidget *widget,
page->requisition.height = tab_height;
}
if (priv->scrollable && vis_pages > 1 &&
requisition->width < tab_width)
tab_width = tab_max + 2 * (scroll_arrow_hlength + arrow_spacing);
if (priv->scrollable)
tab_width = MIN (tab_width,
tab_max + 2 * (scroll_arrow_hlength + arrow_spacing));
action_width += action_widget_requisition[ACTION_WIDGET_START].width;
action_width += action_widget_requisition[ACTION_WIDGET_END].width;
@ -2184,9 +2184,9 @@ gtk_notebook_size_request (GtkWidget *widget,
tab_height += page->requisition.height;
}
if (priv->scrollable && vis_pages > 1 &&
requisition->height < tab_height)
tab_height = tab_max + (2 * scroll_arrow_vlength + arrow_spacing);
if (priv->scrollable)
tab_height = MIN (tab_height,
tab_max + (2 * scroll_arrow_vlength + arrow_spacing));
action_height += action_widget_requisition[ACTION_WIDGET_START].height;
action_height += action_widget_requisition[ACTION_WIDGET_END].height;