After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 98384 - Layout Guidelines
Layout Guidelines
Status: RESOLVED FIXED
Product: gnome-devel-docs
Classification: Applications
Component: hig
unspecified
Other other
: Normal normal
: ---
Assigned To: HIG Maintainers
HIG Maintainers
Depends on: 96374 98779
Blocks:
 
 
Reported: 2002-11-13 11:31 UTC by James Cape
Modified: 2020-12-04 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James Cape 2002-11-13 11:31:10 UTC
While working on a now-infamous screenshotware app, I attempted to follow
the HIG guidelines concerning dialogs & alerts, and have discovered that
the existing guidelines are exceedingly difficult to actually implement,
look overly open (i.e. waste a lot of screen space), and don't really "fit"
well with the Default GTK+ theme. Sooo, weenie that I am, I created some
rules that basically follow the HIG style, but seem to look better, IMO.
Since they are basically easy to use real-world, and don't look half bad
(IMO), I'd really like them to get into the HIG.

GtkDialog:
1.)  dialog->vbox (border_width = 5).
2.)  All other settings default.

GtkMessageDialog:
1.)  For "show again" checkboxes, place the checkbox into an hbox with
padding = 12, then pack_start the hbox into dialog->vbox.
3.)  Set the title of the alert to "Priority Text - Generic Name"
4.)  Set the icon of the alert to the alert style image
(GTK_STOCK_DIALOG_WARNING, etc.).
5.)  All other settings default.

"OSX-style" frames:
1.)  top_box = vbox (spacing = 12)
2.)  group_box = vbox (spacing = 6, fill = FALSE, expand = FALSE)
2.)  title_box = hbox (spacing = 3, fill = FALSE, expand = FALSE)
3.)  title_label = label (bold, fill = FALSE, expand = FALSE)
4.)  title_rule = hseparator
5.)  contents_spacing_box = hbox (fill = (depends), expand = (depends))
6.)  real_contents_box = table/vbox/whatever (padding = 24, spacing =
(depends on use))
7.)  All table labels "Label: [Item]" in the same dialog should belong to
the same horizontal size_group.
8.)  Labels should be right aligned.
9.)  Repeat #2-6 for each "frame".
10.) For "OSX-style" frames as the right pane in a HPaned, place top_box in
an hbox w/ padding = 12.

I think those are basically the rules I've been using so far... if I think
of anything else, I'll followup to this bug.

Examples:
gnomechat/src/prefs-ui.c, gnomechat/src/connect-ui.c
Comment 1 Gregory Merchan 2002-11-15 19:23:37 UTC
See bug #96374 for more information about the problem.

I think GtkFrame should be used for the reasons mentioned
there and becuase it should provide an accessible description
automatically. As long as everyone uses that, there should be
less code churn when time comes to change the layout guidelines.

No comments on Jimbob's spacing recommendation since I haven't
tried them yet.
Comment 2 James Cape 2002-11-28 19:43:06 UTC
Greg also brought up the fact that the HIG vertical spacing rules are
based on the baseline of the font, not the bottom edge of the widget.
Since GTK+/pango don't work that way, the spacing rules should either

    1.) Require the programmer to discover the descender & calculate
the correct spacing appropriately.
    2.) Just reduce the vertical spacing rules to some smaller number
(see above :-)).

Also, the spacing guidelines could really benefit from code examples,
not just Glade info.

i.e.:
"To get HIG frames, do this:
 frame_box = gtk_vbox_new (FALSE, 6);
 ..."
Comment 3 Havoc Pennington 2002-12-04 15:30:03 UTC
gnome-terminal "edit current profile" in CVS is all twelve-spaced 
as the HIG currently suggests, if people want a large example to 
look at.
Comment 4 Murray Cumming 2002-12-06 13:23:30 UTC
No, gnome-terminal "edit current profile" in CVS doesn't seem to be
fully 12-spaced. The buttons at the bottom are closer to the window's
edge. But that's a GtkDialog/HIG issue dealt with in other bugs.
Comment 5 Murray Cumming 2003-07-24 13:58:05 UTC
Closing because
1) GtkFrame is definitely needed for accessibility.
2) We need to make this easier from Glade by changing it's defaults
(I opened Glade bugs for that)
3) It will all be easier in GTK+ 2.4 with the new GtkAlignment
padding, which can be used for indentation.