]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix misplaced separator in GTK3 dialog boxes.
authorSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 09:05:57 +0000 (10:05 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 25 Sep 2015 09:05:57 +0000 (10:05 +0100)
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

index bf2647fd038045aff833835c3f6bf18d7bf13236..cbcc1af50ba8323c66bae5417593de76d24d31d5 100644 (file)
@@ -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
 }