Commit 143a04b2 authored by Martin Nordholts's avatar Martin Nordholts

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.
parent 537dae8d
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment