GNOME Bugzilla – Bug 95773
Change alert dialog border from 12 to 6 pixels?
Last modified: 2020-12-04 18:21:06 UTC
In chapter 8, the section on spacing and alignment, it says you should set the border width of the GtkDialog to 12. This moves the button bar away from the edge of the dialog, and leaves an ugly border around it (see attachment). Is this correct or was the border width of GTK_DIALOG (dialog)->vbox supposed to be set to 12 instead?
Created attachment 11543 [details] Setting the border width to 12 looks dumb.
Looking at it, it doesn't seem quite so dumb, the more I'm used to it. Feel free to close this as NOTABUG if it's just something I need to get used to (and then to get all other app maintainers to change it as well :)
Looking at the screenshot cold, I'm inclined to agree that 12 pixels is perhaps slightly on the excessive side. Seth and I looked at so many different options for these things when we were doing the HIG screenshots that I'm surprised it looks as reasonable as it does :) The whole visual design chapter probably needs the thorough review it never really got before we release a new version of the HIG; this might be something we want to tweak in the process I guess. Of course part of the problem is that you have to specify these things in pixel sizes anyway, they should really be proportional to the current application font size.
Here's a shot of a dialog in my app with border width set to 12 and border width set to 6. I think the 6 looks better, but still conveys the set apart nature...
Created attachment 11601 [details] border width set to 12
Created attachment 11602 [details] border width set to 6
This is related to bug #98384. GtkDialog has style properties (i.e., is themeable) for the entire dialog's border width, the action area border width, and the minimum spacing between buttons in the action area. The HIG should not encourage changing these. Doing so is a waste of programmer time, program memory, etc. Bug #98779 has been filed against Gtk+ so GtkDialog defaults may be changed to match HIG recommendations if need arise.
Actually as far as I can see, for the HIG the action area border width should be 0..otherwise it looks really ugly cos the buttons don't line up with anything.
I suspect we should use 9px. Presumably we want this to be the same for alerts, other dialogs, and those abominations with Close buttons. Alerts are never resizable, but the others may be. When we're able to put a resize grip in the dialogs, we'll need room for it. GtkStatusbar's grip is a isoceles right triangle with leg length 18px. With a dialog border at 9px, that's exactly enough room for a grip of the same size (81px^2). We'll probably want the grip to be a little smaller. A border of 6px gives us a maximum size of only 36px^2.
Ian, I'm not sure where we say to set the border width of GtkDialogs to 12. If we say that somewhere, its a mistake. The spacing information in the alert section is more detailed and explains more clearly how to best implement our suggestions (our suggestion is to have 12 pixels between the border and the buttons, if you measure your attached screenshots you'll find you usually have 18.... ironically the "6" screenshot has about 12, so its reaffirming to find your eyes like the same spacing as ours ;-) Remember that the button box has a default border width of 6 pixels from the get-go. If you look in Chapter 3 in the alerts section we give very specific technical advice on implementing alerts (which have very similar spacings).
I set the border width to 6 and get 12 pixels...nice.
I think the HIG needs to consistently present either end-result spacings or programmatic spacings. Right now it's very confusing because some sections of the HIG seems to be contradicting others. Because of how Gtk+ works (and will probably continue to work for some time), I think programmatic spacings should be given.
So, can we have an example of a dialog that's done right in some app now and then fix the HIG implemenation advice accordingly.