[gthumb] use gtk_widget_reparent to move the file_properties widget in another container



commit 7ebb0b2aefb2160072289d0ab0f896862b782c69
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue May 3 12:35:39 2011 +0200

    use gtk_widget_reparent to move the file_properties widget in another container

 gthumb/gth-browser.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index f827b8c..df2064c 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2278,13 +2278,10 @@ _gth_browser_real_set_current_page (GthWindow *window,
 
 	/* move the sidebar from the browser to the viewer and vice-versa */
 
-	g_object_ref (browser->priv->file_properties);
-	gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (browser->priv->file_properties)), browser->priv->file_properties);
 	if (page == GTH_BROWSER_PAGE_BROWSER)
-		gtk_paned_pack2 (GTK_PANED (browser->priv->browser_sidebar), browser->priv->file_properties, FALSE, TRUE);
-	else if (page == GTH_BROWSER_PAGE_VIEWER)
-		gtk_container_add (GTK_CONTAINER (browser->priv->viewer_sidebar_alignment), browser->priv->file_properties);
-	g_object_unref (browser->priv->file_properties);
+		gtk_widget_reparent (browser->priv->file_properties, browser->priv->browser_sidebar);
+	else
+		gtk_widget_reparent (browser->priv->file_properties, browser->priv->viewer_sidebar_alignment);
 
 	/* update the sidebar state depending on the current visible page */
 



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