Blame hig/C/tabs.page

Packit 1470ea
Packit 1470ea
      xmlns:uix="http://projectmallard.org/experimental/ui/"
Packit 1470ea
      type="topic"
Packit 1470ea
      id="tabs">
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
Packit 1470ea
    <link type="guide" xref="ui-elements"/>
Packit 1470ea
    <uix:thumb mime="image/svg" src="figures/ui-elements/tabs.svg"/>
Packit 1470ea
Packit 1470ea
    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
<title>Tabs</title>
Packit 1470ea
Packit 1470ea

Tabs provide a way to break down a window into a series of views. They come in two primary forms: fixed and dynamic.

Packit 1470ea
Packit 1470ea

Fixed tabs provide an immutable set of predefined views, and are primarily used in dialog windows. Dynamic tabs allow a window to contain mutable selection of content items, such as pages, documents or images. They are primarily used within <link xref="primary-windows">primary windows</link>, as a part of editor or browser applications.

Packit 1470ea
Packit 1470ea
<media type="image" mime="image/svg" src="figures/ui-elements/tabs.svg"/>
Packit 1470ea
Packit 1470ea
<section id="when-to-use">
Packit 1470ea
<title>When to use</title>
Packit 1470ea
Packit 1470ea

Use fixed tabs when a <link xref="dialogs">dialog window</link> contains too many controls (or too much information) to be comfortably presented at once.

Packit 1470ea
Packit 1470ea

Dynamic tabs are primarily useful for browser or editor applications, where a user might want to use several locations or content items simultaneously.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="fixed">
Packit 1470ea
<title>Fixed tabs</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

Do not use too many tabs. If you cannot see all the tabs without scrolling or splitting them into multiple rows, you are probably using too many and should use a list control instead.

</item>
Packit 1470ea
<item>

Label tabs with <link xref="writing-style#capitalization">header capitalization</link>, and use nouns rather than verbs, for example <gui>Font</gui> or <gui>Alignment</gui>. Try to give tab labels a similar length.

</item>
Packit 1470ea
<item>

Do not design tabs such that changing controls on one page affects the controls on any other page. Users are unlikely to discover such dependencies.

</item>
Packit 1470ea
<item>

If a control affects every tab, place it outside the tabs.

</item>
Packit 1470ea
<item>

With fixed tabs, make the width of each tab proportional to the width of its label. Don’t just set all the tabs to the same width, as this makes them harder to scan visually, and limits the number of tabs you can display without scrolling.

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="dynamic">
Packit 1470ea
<title>Dynamic tabs</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

Tabs often have a constrained width, so ensure that tab labels are short and concise, and that the most useful part of the label is displayed first. This ensures that the label continues to be useful even when ellipsized.

</item>
Packit 1470ea
<item>

If the content of a tab changes or requires attention, a visual hint can be displayed.

</item>
Packit 1470ea
<item>

Provide a context menu on each tab. This menu should only include actions for manipulating the tab itself, such as <gui>Move Left</gui>, <gui>Move Right</gui>, <gui>Move to New Window</gui>, and <gui>Close</gui>.

</item>
Packit 1470ea
<item>

If tabs are an important part of the application, a new tab button can be placed in the header bar or toolbar. Do not show a new tab button in applications where tabs will not always be used - keyboard shortcuts and/or menu items are sufficient in these cases.

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea
<section id="keyboard-shortcuts">
Packit 1470ea
<title>Standard Keyboard Shortcuts</title>
Packit 1470ea
Packit 1470ea

When using dynamic tabs, ensure that the standard keyboard shortcuts are supported.

Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea

<keyseq><key>Ctrl</key><key>T</key></keyseq>

Packit 1470ea

Create a new tab

Packit 1470ea
Packit 1470ea
Packit 1470ea

<keyseq><key>Ctrl</key><key>W</key></keyseq>

Packit 1470ea

Close the current tab

Packit 1470ea
Packit 1470ea
Packit 1470ea

<keyseq><key>Ctrl</key><key>Page Up</key></keyseq>

Packit 1470ea

Switch to the next tab

Packit 1470ea
Packit 1470ea
Packit 1470ea

<keyseq><key>Ctrl</key><key>Page Down</key></keyseq>

Packit 1470ea

Switch to the previous tab

Packit 1470ea
Packit 1470ea
Packit 1470ea
Packit 1470ea
</section>
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/GtkNotebook.html">GtkNotebook</link>

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