Blame hig/C/header-bars.page

Packit 1470ea
Packit 1470ea
      xmlns:uix="http://projectmallard.org/experimental/ui/"
Packit 1470ea
      type="topic"
Packit 1470ea
      id="header-bars">
Packit 1470ea
Packit 1470ea
  <info>
Packit 1470ea
    <link type="guide" xref="patterns#primary"/>
Packit 1470ea
    <desc>Element that runs along the top of windows</desc>
Packit 1470ea
    <credit type="author">
Packit 1470ea
      <name>Allan Day</name>
Packit 1470ea
      <email>aday@gnome.org</email>
Packit 1470ea
    </credit>
Packit 1470ea
    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
<title>Header bars</title>
Packit 1470ea
Packit 1470ea
<media type="image" mime="image/svg" src="figures/patterns/header-bar.svg"/>
Packit 1470ea
Packit 1470ea

Header bars are a common horizontal element which are placed at the top of windows. They play a number of roles:

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

Window controls - header bars allow windows to be moved by dragging, include window control buttons (typically a single close button), and provide access to a window controls menu.

</item>
Packit 1470ea
<item>

Headings - a key role of a header bar is to provide context for the content of the window, either through a heading or view switcher.

</item>
Packit 1470ea
<item>

Controls - header bars provide a place for key controls, typically in the form of buttons.

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea
<section id="when-to-use">
Packit 1470ea
<title>When to use</title>
Packit 1470ea
Packit 1470ea

Header bars are recommended for all application windows. They provide a number of advantages over the traditional combination of title bar, menu bar and toolbar, including a smaller vertical footprint, and dynamic navigation and mode changes (such as with <link xref="selection-mode">selection mode</link>).

Packit 1470ea
Packit 1470ea

Header bars are incompatible with menu bars. If your application already incorporates a menu bar, you should evaluate the alternatives suggested in these guidelines. See the <link xref="menu-bars">menu bar guidelines</link> for more details on this.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="controls">
Packit 1470ea
<title>Controls</title>
Packit 1470ea
Packit 1470ea

Header bars can contain key controls for the window, which can be placed on the left and right-hand side of the header bar. Examples of these controls include buttons for navigating back and forward, search, and selecting content.

Packit 1470ea
Packit 1470ea

Ensure that your header bar only contains a small number of key controls - this will help users to understand the primary functionality provided by the window, and will ensure that the window can be resized to narrow widths.

Packit 1470ea
Packit 1470ea

If a window requires more controls than can be comfortably accommodated within the header bar, additional functionality can be included within a header bar menu.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dynamic">
Packit 1470ea
<title>Header bars are dynamic</title>
Packit 1470ea
Packit 1470ea

A header bar can - and should - update along with view or mode changes. This ensures that header bar controls are always relevant to the current context.

Packit 1470ea
Packit 1470ea

If the window includes multiple views (accessed through a <link xref="view-switchers">view switcher</link>), the header bar can include different controls for each view.

Packit 1470ea
Packit 1470ea

If the window incorporates navigation, different controls can be shown depending on the location displayed in the window itself. It is common to show a back button on the left side of the header bar when navigating.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="additional-guidance">
Packit 1470ea
<title>Additional guidance</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

A header bar should always provide context for the window it belongs to. This aids window identification, and clarifies what is displayed in the window itself. This can either be done by placing a heading in the center of the header bar, or by including a <link xref="view-switchers">view switcher</link>.

</item>
Packit 1470ea
<item>

Arrange controls within the header bar according to the three alignment points described in the <link xref="visual-layout">visual layout guidelines</link> - left, center and right.

</item>
Packit 1470ea
<item>

<gui>New</gui> and back buttons should be placed on the left side of the header bar.

</item>
Packit 1470ea
<item>

Always ensure that there is room for a header bar to be dragged. This is necessary to enable windows to be moved or resized.

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="api-reference">
Packit 1470ea
<title>API reference</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

<link href="https://developer.gnome.org/gtk3/stable/GtkHeaderBar.html">GtkHeaderBar</link>

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