notebook: Simplify gtk_notebook_map()

We set visibility on our children properly, so we can simply chain up
and let the GtkContainer implementation do the mapping of children.
This commit is contained in:
Benjamin Otte 2015-12-19 08:03:41 +01:00
parent 22398ef459
commit dc4148c4e2

View File

@ -1972,43 +1972,8 @@ gtk_notebook_map (GtkWidget *widget)
{
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkNotebookPrivate *priv = notebook->priv;
GtkNotebookPage *page;
GList *children;
gint i;
gtk_widget_set_mapped (widget, TRUE);
if (priv->cur_page &&
gtk_widget_get_visible (priv->cur_page->child) &&
!gtk_widget_get_mapped (priv->cur_page->child))
gtk_widget_map (priv->cur_page->child);
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
if (priv->action_widget[i] &&
gtk_widget_get_visible (priv->action_widget[i]) &&
gtk_widget_get_child_visible (priv->action_widget[i]) &&
!gtk_widget_get_mapped (priv->action_widget[i]))
gtk_widget_map (priv->action_widget[i]);
}
if (priv->scrollable)
gtk_notebook_pages_allocate (notebook);
else
{
children = priv->children;
while (children)
{
page = children->data;
children = children->next;
if (page->tab_label &&
gtk_widget_get_visible (page->tab_label) &&
!gtk_widget_get_mapped (page->tab_label))
gtk_widget_map (page->tab_label);
}
}
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->map (widget);
if (gtk_notebook_get_event_window_position (notebook, NULL))
gdk_window_show_unraised (priv->event_window);