[geany/geany] fa7959: Maintain sidebar width when sidebar is on the right

Nick Treleaven git-noreply at xxxxx
Tue Apr 3 15:15:02 UTC 2012


Branch:      refs/heads/master
Author:      Nick Treleaven <nick.treleaven at btinternet.com>
Committer:   Nick Treleaven <nick.treleaven at btinternet.com>
Date:        Tue, 03 Apr 2012 15:15:02
Commit:      fa7959f31652612f72cc6dadbeb5e846373eac61
             https://github.com/geany/geany/commit/fa7959f31652612f72cc6dadbeb5e846373eac61

Log Message:
-----------
Maintain sidebar width when sidebar is on the right

Resizing the window should not affect sidebar width.
Fixes #3514436.


Modified Paths:
--------------
    src/ui_utils.c

Modified: src/ui_utils.c
15 files changed, 9 insertions(+), 6 deletions(-)
===================================================================
@@ -2000,13 +2000,16 @@ void ui_swap_sidebar_pos(void)
 	GtkWidget *pane = ui_lookup_widget(main_widgets.window, "hpaned1");
 	GtkWidget *left = gtk_paned_get_child1(GTK_PANED(pane));
 	GtkWidget *right = gtk_paned_get_child2(GTK_PANED(pane));
-	GtkWidget *box = ui_lookup_widget(main_widgets.window, "vbox1");
 
-	/* reparenting avoids scintilla problem with middle click paste */
-	gtk_widget_reparent(left, box);
-	gtk_widget_reparent(right, box);
-	gtk_widget_reparent(right, pane);
-	gtk_widget_reparent(left, pane);
+	g_object_ref(left);
+	g_object_ref(right);
+	gtk_container_remove (GTK_CONTAINER (pane), left);
+	gtk_container_remove (GTK_CONTAINER (pane), right);
+	/* only scintilla notebook should expand */
+	gtk_paned_pack1(GTK_PANED(pane), right, right == main_widgets.notebook, TRUE);
+	gtk_paned_pack2(GTK_PANED(pane), left, left == main_widgets.notebook, TRUE);
+	g_object_unref(left);
+	g_object_unref(right);
 
 	gtk_paned_set_position(GTK_PANED(pane), pane->allocation.width
 		- gtk_paned_get_position(GTK_PANED(pane)));


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list