[gimp] app: Keep original GimpDockColumns size when moving out to a dock window



commit 143a04b2d0531507afefdd2a19531f51dfb93562
Author: Martin Nordholts <martinn src gnome org>
Date:   Thu Aug 4 21:42:43 2011 +0200

    app: Keep original GimpDockColumns size when moving out to a dock window
    
    When moving out GimpDock:s from a GimpDockColumns into a new
    GimpDockWindow when switching off single-window mode, try to preserve
    the size of the original GimpDockColumns.

 app/gui/gimpuiconfigurer.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 821a06d..6201f13 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -285,11 +285,17 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer  *ui_configurer,
                                          GimpDockColumns   *dock_columns,
                                          GimpAlignmentType  screen_side_destination)
 {
-  GdkScreen *screen           = gtk_widget_get_screen (GTK_WIDGET (dock_columns));
-  GList     *docks            = g_list_copy (gimp_dock_columns_get_docks (dock_columns));
-  GList     *iter             = NULL;
-  gboolean   contains_toolbox = FALSE;
-  GtkWidget *dock_window      = NULL;
+  GdkScreen    *screen           = gtk_widget_get_screen (GTK_WIDGET (dock_columns));
+  GList        *docks            = g_list_copy (gimp_dock_columns_get_docks (dock_columns));
+  GList        *iter             = NULL;
+  gboolean      contains_toolbox = FALSE;
+  GtkWidget    *dock_window      = NULL;
+  GtkAllocation original_size    = { 0, 0, 0, 0 };
+
+  /* Remember the size so we can set the new dock window to the same
+   * size
+   */
+  gtk_widget_get_allocation (GTK_WIDGET (dock_columns), &original_size);
 
   /* Do we need a toolbox window? */
   for (iter = docks; iter; iter = iter->next)
@@ -337,6 +343,11 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer  *ui_configurer,
   else
     g_assert_not_reached ();
 
+  /* Try to keep the same size */
+  gtk_window_set_default_size (GTK_WINDOW (dock_window),
+                               original_size.width,
+                               original_size.height);
+
   /* Don't forget to show the window */
   gtk_widget_show (dock_window);
 



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