From 1f9df706b5b4ae38b33b7dbd4c34c774c014c06d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 24 Mar 2016 07:19:09 +0000 Subject: [PATCH 1/1] GTK 3 fake dialog action area: fix margins and spacing. The About box is where it showed up most obviously that I'd hastily bunged a GtkBox inside another GtkBox without considering their margins: the 'action area' had twice the margin it should have had and the rightmost button didn't align with the right edge of the rest of the window contents. Easily fixed by giving the inner hbox margin 0 (fixing the right align and the excessive space around all the buttons), and using the 'spacing' property of GtkBox to ensure multiple buttons in it are nicely separated without having to take care over that in the client code that adds them. --- unix/gtkmisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unix/gtkmisc.c b/unix/gtkmisc.c index d3619e2d..6ee68be2 100644 --- a/unix/gtkmisc.c +++ b/unix/gtkmisc.c @@ -175,6 +175,8 @@ GtkBox *our_dialog_make_action_hbox(GtkWindow *dlg) #if GTK_CHECK_VERSION(3,0,0) GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); our_dialog_set_action_area(dlg, hbox); + g_object_set(G_OBJECT(hbox), "margin", 0, (const char *)NULL); + g_object_set(G_OBJECT(hbox), "spacing", 8, (const char *)NULL); gtk_widget_show(hbox); return GTK_BOX(hbox); #else /* not GTK 3 */ -- 2.45.2