Commit edd2f24b authored by Benjamin Otte's avatar Benjamin Otte

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.
parent 86aefc2c
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment