[gtk+] notebook: Simplify gtk_notebook_map()



commit dc4148c4e2d17e43f9c06dd41334de642755ce0d
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 19 08:03:41 2015 +0100

    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.

 gtk/gtknotebook.c |   37 +------------------------------------
 1 files changed, 1 insertions(+), 36 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 1527606..c71b43b 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]