Blame hig/C/view-switchers.page

Packit 1470ea
Packit 1470ea
      type="topic"
Packit 1470ea
      id="view-switchers">
Packit 1470ea
Packit 1470ea
  <info>
Packit 1470ea
    <link type="guide" xref="patterns#secondary"/>
Packit 1470ea
    <desc>Toggle buttons that change the view, like tabs</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>View switchers</title>
Packit 1470ea
Packit 1470ea
<media type="image" mime="image/svg" src="figures/patterns/view-switcher.svg"/>
Packit 1470ea
Packit 1470ea

A view switcher is a control that allows switching between a number of predefined views. It appears as a set of toggle buttons that are placed in the center of a header bar.

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

There are two primary cases when a view switcher is appropriate:

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

When presenting content, and it is useful to be able to view different sets or sub-sets of content. For example, a music application could show different views for artists, albums and playlists.

</item>
Packit 1470ea
<item>

If your application provides discrete groups of functionality which are typically used independently.

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

As a rule of thumb, a view switcher should contain between three and five views. If you have more views, a <link xref="sidebar-lists">sidebar list</link> might be a more appropriate view switching control.

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

Each view should have a short and clear title.

</item>
Packit 1470ea
<item>

Buttons in the view switcher widget can indicate when there is activity in a view.

</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
<list>
Packit 1470ea
<item>

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

</item>
Packit 1470ea
<item>

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

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