From 24967601bb59ffd608a46f7667ccff9326f6faf9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 25 Sep 2015 10:05:57 +0100 Subject: [PATCH] Fix misplaced separator in GTK3 dialog boxes. When I abandoned GtkDialog for GtkWindow (in dc11417ae), I manually added a horizontal GtkSeparator between the content and action areas. Or rather, I tried to - but I forgot that gtk_box_pack_end works in the opposite order, so that you have to add the bottom-most element first and then the one you want to appear above it. So my separator was below the action area, rather than between it and the content area. --- unix/gtkmisc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unix/gtkmisc.c b/unix/gtkmisc.c index bf2647fd..cbcc1af5 100644 --- a/unix/gtkmisc.c +++ b/unix/gtkmisc.c @@ -156,14 +156,15 @@ void our_dialog_set_action_area(GtkWindow *dlg, GtkWidget *w) /* GtkWindow is a GtkBin, hence contains exactly one child, which * here we always expect to be a vbox */ GtkBox *vbox = GTK_BOX(gtk_bin_get_child(GTK_BIN(dlg))); - - GtkWidget *sep = gtk_hseparator_new(); - gtk_box_pack_end(vbox, sep, FALSE, TRUE, 0); - gtk_widget_show(sep); + GtkWidget *sep; g_object_set(G_OBJECT(w), "margin", 8, (const char *)NULL); gtk_box_pack_end(vbox, w, FALSE, TRUE, 0); + sep = gtk_hseparator_new(); + gtk_box_pack_end(vbox, sep, FALSE, TRUE, 0); + gtk_widget_show(sep); + #endif }