[gthumb/ext] fixed a resize window bug when showing the sidebar again



commit ab65826c2af0afcecc2c638fe16fb2b857243287
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Oct 18 20:31:35 2009 +0200

    fixed a resize window bug when showing the sidebar again

 gthumb/gth-browser.c   |    8 ++++++--
 gthumb/gth-icon-view.c |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 24e6ca9..2ee9652 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -3042,8 +3042,11 @@ _gth_browser_set_sidebar_visibility  (GthBrowser *browser,
 	g_return_if_fail (browser != NULL);
 
 	_gth_browser_set_action_active (browser, "View_Sidebar", visible);
-	if (visible)
+	if (visible) {
 		gtk_widget_show (browser->priv->browser_sidebar);
+		gtk_paned_set_position (GTK_PANED (browser->priv->browser_container), eel_gconf_get_integer (PREF_UI_BROWSER_SIDEBAR_WIDTH, DEF_SIDEBAR_WIDTH));
+		gtk_paned_set_position (GTK_PANED (browser->priv->browser_sidebar), browser->priv->browser_sidebar->allocation.height / 2);
+	}
 	else
 		gtk_widget_hide (browser->priv->browser_sidebar);
 }
@@ -3308,7 +3311,6 @@ _gth_browser_construct (GthBrowser *browser)
 	browser->priv->browser_sidebar = gtk_vpaned_new ();
 	gtk_widget_show (browser->priv->browser_sidebar);
 	gtk_paned_pack1 (GTK_PANED (browser->priv->browser_container), browser->priv->browser_sidebar, FALSE, TRUE);
-	_gth_browser_set_sidebar_visibility (browser, eel_gconf_get_boolean (PREF_UI_SIDEBAR_VISIBLE, TRUE));
 
 	/* the box that contains the location and the folder list.  */
 
@@ -3482,6 +3484,8 @@ _gth_browser_construct (GthBrowser *browser)
 	_gtk_paned_set_position2 (GTK_PANED (browser->priv->viewer_pane), eel_gconf_get_integer (PREF_UI_VIEWER_SIDEBAR_WIDTH, DEF_VIEWER_SIDEBAR_WIDTH));
 	_gtk_paned_set_position2 (GTK_PANED (browser->priv->browser_sidebar), eel_gconf_get_integer (PREF_UI_PROPERTIES_HEIGHT, DEF_PROPERTIES_HEIGHT));
 
+	_gth_browser_set_sidebar_visibility (browser, eel_gconf_get_boolean (PREF_UI_SIDEBAR_VISIBLE, TRUE));
+
 	_gth_browser_set_toolbar_visibility (browser, eel_gconf_get_boolean (PREF_UI_TOOLBAR_VISIBLE, TRUE));
 	_gth_browser_update_toolbar_style (browser);
 	_gth_browser_update_entry_point_list (browser);
diff --git a/gthumb/gth-icon-view.c b/gthumb/gth-icon-view.c
index 03b4706..f35e0eb 100644
--- a/gthumb/gth-icon-view.c
+++ b/gthumb/gth-icon-view.c
@@ -27,6 +27,7 @@
 
 #define IMAGE_TEXT_SPACING 5
 #define ICON_SPACING 12
+#define SIZE_REQUEST 50
 
 
 static gpointer               gth_icon_view_parent_class = NULL;
@@ -463,6 +464,7 @@ gth_icon_view_init (GthIconView *icon_view)
 	gtk_icon_view_set_column_spacing (GTK_ICON_VIEW (icon_view), ICON_SPACING);
 	gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (icon_view), ICON_SPACING);
 	gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), GTK_SELECTION_MULTIPLE);
+	gtk_widget_set_size_request (GTK_WIDGET (icon_view), SIZE_REQUEST, SIZE_REQUEST);
 }
 
 



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