Blame hig/C/menu-bars.page

Packit 1470ea
Packit 1470ea
      xmlns:uix="http://projectmallard.org/experimental/ui/"
Packit 1470ea
      type="topic"
Packit 1470ea
      id="menu-bars">
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/menu-bar.svg"/>
Packit 1470ea
Packit 1470ea
    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
<title>Menu bars</title>
Packit 1470ea
Packit 1470ea

A menu bar incorporates a strip of drop-down menus. It is typically located at the top of a primary window, below a window title bar.

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

Menu bars increase the vertical footprint of an application’s user interface, introduce a large number of disclosure points, and function as a fixed set of inflexible options. For these reasons, <link xref="header-bars">header bars</link> and <link xref="header-bar-menus">header bar menus</link> are generally recommended over menu bars, along with other design patterns for exposing controls on demand, such as <link xref="selection-mode">selection mode</link>, <link xref="action-bars">action bars</link>, and <link xref="popovers">popovers</link>.

Packit 1470ea
Packit 1470ea

At the same time, it can be appropriate for complex applications that already include a menu bar to retain it. Additionally, some platforms also incorporate space for a menu bar in their user environment, and a menu model can be desirable for cross-platform integration purposes.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="standard-menus">
Packit 1470ea
<title>Standard menus</title>
Packit 1470ea
Packit 1470ea

This section details the most common menus and menu items in a menu bar. For details on the standard items to include in each of these menus, see <link xref="keyboard-input#application-shortcuts">keyboard input</link>.

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

<gui>File</gui>

Packit 1470ea

Commands that operate on the current document or content item as a whole. It is the left-most item in the menubar because of its importance and frequency of use, and because it is a relevant menu in many applications.

Packit 1470ea

If your application does not operate on files, name this menu for the type of object it displays. For example, a music player could have a <gui>Music</gui> instead of a <gui>File</gui> menu.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Edit</gui>

Packit 1470ea

The <gui>Edit</gui> menu contains items relating to editing the document, such as clipboard handling, find and replace, and inserting objects.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>View</gui>

Packit 1470ea

Includes items that affect the user’s view, such as of the current document or page, or how items are presented for browsing. Do not place any items on the <gui>View</gui> menu that affect content items.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Insert</gui>

Packit 1470ea

Lists the types of objects that can be inserted into the current document, such as images, links or page breaks. Only provide this menu if you have more than about six types of object that can be inserted, otherwise place individual items for each type on the <gui>Edit</gui> menu.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Format</gui>

Packit 1470ea

Includes commands to change the visual appearance of the document. For example, changing the font, color, or line spacing of a text selection.

Packit 1470ea

The difference between these commands and those on the <gui>View</gui> menu is that changes made with <gui>Format</gui> commands are persistent and saved as part of the document.

Packit 1470ea

Items found on the Format menu are very application-specific.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Bookmarks</gui>

Packit 1470ea

Provide a Bookmarks menu in any application that allows the user to browse files and folders, help documents, web pages or any other large information space.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Go</gui>

Packit 1470ea

A <gui>Go</gui> menu provides commands for quickly navigating around a document or collection of documents, or an information space such as a directory structure or the web.

Packit 1470ea

The contents of the menu will vary depending on the type of application.

Packit 1470ea
Packit 1470ea
Packit 1470ea

<gui>Windows</gui>

Packit 1470ea

Commands that apply to all of the application’s open windows. You may also label this menu <gui>Documents</gui>, <gui>Buffers</gui>, or similar according to the type of document handled by your application.

Packit 1470ea

The last items on this menu are a numbered list of the application’s primary windows, for example <gui>1shoppinglist.abw</gui>. Selecting one of these items raises the corresponding window.

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

The menubar is normally visible at all times and is always accessible from the keyboard, so make all the commands available in your application available on the menubar. (This guideline is unique to menu bars - other menus should not seek to reproduce functionality that is made available by other controls).

</item>
Packit 1470ea
<item>

Treat <link xref="application-menus">application menus</link> as part of the menu bar - it is not necessary to reproduce items from the application menu in other menus.

</item>
Packit 1470ea
<item>

Do not disable menu titles. Allow the user to explore the menu, even though there might be no available items on it at that time.

</item>
Packit 1470ea
<item>

Menu titles on a menubar are single words with their first letter capitalized. Do not use spaces in menu titles, as this makes them easily-mistaken for two separate menu titles. Do not use compound words (such as <gui>WindowOptions</gui>) or hyphens (such as <gui>Window-Options</gui>) to circumvent this guideline.

</item>
Packit 1470ea
<item>

Do not provide a mechanism for hiding the menubar, as this may be activated accidentally. Some users will not be able to figure out how to get the menu bar back in this case.

</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/GtkMenu.html">GtkMenu</link>

</item>
Packit 1470ea
<item>

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

</item>
Packit 1470ea
<item>

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

</item>
Packit 1470ea
<item>

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

</item>
Packit 1470ea
<item>

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

</item>
Packit 1470ea
<item>

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

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