notebook: No page switching in size request code

We have page switching under control now, we don't need to check every
get_preferred_size() call.
This commit is contained in:
Benjamin Otte 2015-12-19 06:56:48 +01:00
parent 1190efebce
commit 0e528ec74e

View File

@ -2274,7 +2274,6 @@ gtk_notebook_measure_contents (GtkCssGadget *gadget,
GtkNotebookPage *page;
GList *children;
gint child_minimum, child_natural;
gboolean switch_page = FALSE;
gint vis_pages;
guint border_width;
@ -2300,11 +2299,6 @@ gtk_notebook_measure_contents (GtkCssGadget *gadget,
*minimum = MAX (*minimum, child_minimum);
*natural = MAX (*natural, child_natural);
}
else
{
if (page == priv->cur_page)
switch_page = TRUE;
}
}
if (priv->show_tabs)
@ -2355,36 +2349,6 @@ gtk_notebook_measure_contents (GtkCssGadget *gadget,
*minimum += border_width * 2;
*natural += border_width * 2;
if (switch_page)
{
if (vis_pages)
{
for (children = priv->children; children;
children = children->next)
{
page = children->data;
if (gtk_widget_get_visible (page->child))
{
gtk_notebook_switch_page (notebook, page);
break;
}
}
}
else if (gtk_widget_get_visible (widget))
{
*minimum = border_width * 2;
}
}
if (vis_pages && !priv->cur_page)
{
children = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, TRUE);
if (children)
{
priv->first_tab = children;
gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (children));
}
}
}
static void