]> spindle.queued.net Git - midori/commitdiff
Switch to Tab Panel after activating it for the first time
authorChristian Dywan <christian@twotoasts.de>
Sun, 22 Aug 2010 19:19:14 +0000 (21:19 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 23 Aug 2010 17:38:11 +0000 (19:38 +0200)
extensions/tab-panel.c

index 2d182d5ef34bcdde86578584c0c5640ecde37392..beabcda5f99408538cad41757412c4279f7a8502 100644 (file)
@@ -498,6 +498,7 @@ tab_panel_app_add_browser_cb (MidoriApp*       app,
     GtkCellRenderer* renderer_text;
     GtkWidget* panel;
     GtkWidget* toolbar;
+    gint i;
     /* GtkToolItem* toolitem; */
 
     g_object_set (browser, "show-tabs", FALSE, NULL);
@@ -564,8 +565,10 @@ tab_panel_app_add_browser_cb (MidoriApp*       app,
     gtk_widget_show (GTK_WIDGET (toolitem));
     gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, -1); */
 
-    midori_panel_append_widget (MIDORI_PANEL (panel), treeview,
-                                STOCK_TAB_PANEL, _("Tab Panel"), toolbar);
+    i = midori_panel_append_widget (MIDORI_PANEL (panel), treeview,
+                                    STOCK_TAB_PANEL, _("Tab Panel"), toolbar);
+    if (gtk_widget_get_visible (GTK_WIDGET (browser)))
+        midori_panel_set_current_page (MIDORI_PANEL (panel), i);
     g_object_unref (panel);
 
     midori_browser_foreach (browser,