]> Pileus Git - ~andy/gtk/commitdiff
Do not unset the brand new current page if there was none set previously.
authorCarlos Garnacho <carlos@imendio.com>
Fri, 18 May 2007 09:42:52 +0000 (09:42 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Fri, 18 May 2007 09:42:52 +0000 (09:42 +0000)
2007-05-18  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtknotebook.c (gtk_notebook_real_insert_page): Do not unset
        the brand new current page if there was none set previously. Fixes
        #425138 (Reported by Michail Crayson). Some code simplifications.
        (gtk_notebook_draw_arrow): code style fix.

svn path=/trunk/; revision=17858

ChangeLog
gtk/gtknotebook.c

index 686ad45e481840d1c794dcf3aa85360254e13292..596d1a82d8d16ba9a38ec43fa64312e89e7c0c92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-18  Carlos Garnacho  <carlos@imendio.com>
+
+       * gtk/gtknotebook.c (gtk_notebook_real_insert_page): Do not unset
+       the brand new current page if there was none set previously. Fixes
+       #425138 (Reported by Michail Crayson). Some code simplifications.
+       (gtk_notebook_draw_arrow): code style fix.
+
 2007-05-16  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkpathbar.c: Add ATK names to the Up, Down, and Root
index bd5c9233d3fa4429b96d0997d2b9879fb4646037..9790d1218e12da2e75a84ed32bff413bd89b42bf 100644 (file)
@@ -3932,22 +3932,10 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
 
   gtk_widget_freeze_child_notify (child);
-  
-  page = g_new (GtkNotebookPage, 1);
+
+  page = g_new0 (GtkNotebookPage, 1);
   page->child = child;
-  page->last_focus_child = NULL;
-  page->requisition.width = 0;
-  page->requisition.height = 0;
-  page->allocation.x = 0;
-  page->allocation.y = 0;
-  page->allocation.width = 0;
-  page->allocation.height = 0;
-  page->default_menu = FALSE;
-  page->default_tab = FALSE;
-  page->mnemonic_activate_signal = 0;
-  page->reorderable = FALSE;
-  page->detachable = FALSE;
-   
+
   nchildren = g_list_length (notebook->children);
   if ((position < 0) || (position > nchildren))
     position = nchildren;
@@ -3958,7 +3946,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
     {
       page->default_tab = TRUE;
       if (notebook->show_tabs)
-       tab_label = gtk_label_new ("");
+       tab_label = gtk_label_new (NULL);
     }
   page->tab_label = tab_label;
   page->menu_label = menu_label;
@@ -4014,7 +4002,8 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   if (!notebook->cur_page)
     {
       gtk_notebook_switch_page (notebook, page, 0);
-      gtk_notebook_switch_focus_tab (notebook, NULL);
+      /* focus_tab is set in the switch_page method */
+      gtk_notebook_switch_focus_tab (notebook, notebook->focus_tab);
     }
 
   gtk_notebook_update_tab_states (notebook);
@@ -4664,7 +4653,7 @@ gtk_notebook_draw_arrow (GtkNotebook      *notebook,
 
       if (notebook->focus_tab &&
          !gtk_notebook_search_page (notebook, notebook->focus_tab,
-                                     left? STEP_PREV : STEP_NEXT, TRUE))
+                                    left ? STEP_PREV : STEP_NEXT, TRUE))
        {
          shadow_type = GTK_SHADOW_ETCHED_IN;
          state_type = GTK_STATE_INSENSITIVE;