Blame hig/C/visual-layout.page

Packit 1470ea
Packit 1470ea
      type="topic"
Packit 1470ea
      id="visual-layout">
Packit 1470ea
Packit 1470ea
  <info>
Packit 1470ea
    <credit type="author">
Packit 1470ea
      <name>Allan Day</name>
Packit 1470ea
      <email>aday@gnome.org</email>
Packit 1470ea
    </credit>
Packit 1470ea
    <credit>
Packit 1470ea
      <name>Calum Benson</name>
Packit 1470ea
    </credit>
Packit 1470ea
    <credit>
Packit 1470ea
      <name>Adam Elman</name>
Packit 1470ea
    </credit>
Packit 1470ea
    <credit>
Packit 1470ea
      <name>Seth Nickell</name>
Packit 1470ea
    </credit>
Packit 1470ea
    <credit>
Packit 1470ea
      <name>Colin Robertson</name>
Packit 1470ea
    </credit>
Packit 1470ea
    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
Packit 1470ea
    <desc>Arranging elements within a user interface.</desc>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
<title>Visual layout</title>
Packit 1470ea
Packit 1470ea

The visual layout of controls, information and content affects how easy it is to understand your application, as well as how beautiful it is. It is important to recognise that visual design has a strong impact on how much work is involved in using an application - poor layout results in users having to put in additional effort, while good layout requires less effort.

Packit 1470ea
Packit 1470ea

Following these visual layout guidelines will help you to produce an application that is beautiful, easy to understand, and efficient to use.

Packit 1470ea
Packit 1470ea
<section id="general-guidelines">
Packit 1470ea
<title>General guidelines</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

An alignment point is an imaginary vertical or horizontal line through your window that touches the edge of one or more labels or controls in the window. Minimize the number of these - the fewer there are, the cleaner and simpler your layout will appear, and the easier it will be for people to understand.

</item>
Packit 1470ea
<item>

Align content and controls in your layout exactly. The eye is very sensitive to aligned and unaligned objects. If visual elements do not line up, it will be hard for someone to scan them. Elements that do not quite line up will be distracting.

</item>
Packit 1470ea
<item>

Be consistent. Use the same amounts of spacing throughout.

</item>
Packit 1470ea
<item>

Organize related controls and information into groups, and use spacing to differentiate them. This makes an interface far easier to read and understand.

Packit 1470ea
<list>
Packit 1470ea
<item>

As a rule of thumb, leave space between elements in increments of 6 pixels, going up as the relationship between related elements becomes more distant.

</item>
Packit 1470ea
<item>

Between labels and associated components, leave 12 horizontal pixels.

</item>
Packit 1470ea
<item>

For vertical spacing between groups of components, 18 pixels is adequate.

</item>
Packit 1470ea
<item>

A general padding of 18 pixels is recommended between the contents of a dialog window and the window borders.

</item>
Packit 1470ea
</list></item>
Packit 1470ea
<item>

Indent elements by 12 pixels to denote hierarchy and association.

</item>
Packit 1470ea
<item>

Avoid using frames with visible borders to separate groups of controls - use spacing and headers instead.

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea

Incorrect spacing and alignment:

Packit 1470ea
<media type="image" mime="image/svg" src="figures/visual-alignment-incorrect.svg"/>
Packit 1470ea
Packit 1470ea

Correct spacing and alignment:

Packit 1470ea
<media type="image" mime="image/svg" src="figures/visual-alignment-correct.svg"/>
Packit 1470ea
Packit 1470ea

Correct spacing, with units (pixels):

Packit 1470ea
<media type="image" mime="image/svg" src="figures/visual-alignment-spacing.svg"/>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="label-alignment">
Packit 1470ea
<title>Label alignment</title>
Packit 1470ea
Packit 1470ea

If possible, right-justify labels (see the diagram below). This will avoid large gaps between labels and their associated controls. This type of right-justification is not possible if you have indented controls: here left-justification should be used instead.

Packit 1470ea
Packit 1470ea
<media type="image" mime="image/svg" src="figures/label-alignment.svg"/>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="hierarchy">
Packit 1470ea
<title>Visual hierarchy</title>
Packit 1470ea
Packit 1470ea

Organize visual elements from top-to-bottom and left-to-right. This is the direction that people from western locales tend to read an interface, so that the items at the top-left will be encountered first. This ordering gives interfaces a hierarchy: those components that are viewed first are perceived to have priority over those that come after them. For this reason, you should place dominant controls above and to the left of the controls and content that they affect. Header bars are a key design pattern in this respect.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
</page>