<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" xmlns:uix="http://projectmallard.org/experimental/ui/" type="topic" id="primary-menus" xml:lang="sv">

  <info>
    <link type="guide" xref="patterns#primary"/>
    <desc>Programmets huvudmeny, markerad med en stapel med tre horisontella linjer</desc>
    <credit type="author">
      <name>Allan Day</name>
      <email>aday@gnome.org</email>
    </credit>
    <include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Anders Jonsson</mal:name>
      <mal:email>anders.jonsson@norsjovallen.se</mal:email>
      <mal:years>2015, 2018</mal:years>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Sebastian Rasmussen</mal:name>
      <mal:email>sebras@gmail.com</mal:email>
      <mal:years>2017, 2018</mal:years>
    </mal:credit>
  </info>

<title>Primärmenyer</title>

<media type="image" mime="image/svg" src="figures/patterns/primary-menu.svg"/>

<p>Primary menus are a standard design pattern that is found in most applications. They are labelled with the menu icon (named <code>menu-open</code>) and contain the top-level menu items for the application. This can include standard items like <gui>Preferences</gui>, <gui>Help</gui> and <gui>About Application</gui>, as well as other application-specific items.</p>


<section id="when-to-use">
<title>När ska de användas</title>

<p>Most applications have primary menus, since they are the standard location for <gui>About Application</gui>, which every application is expected to have.</p>

</section>

<section id="guidance">
<title>Råd</title>

<p>Primary menus are typically placed on the right side of the header bar. However, there are two variations on this rule:</p>

<list>
<item><p>If the application incorporates in-window navigation, with a top-level location and sub-pages, the primary menu should only be placed on the top level: sub-pages can include a <link xref="secondary-menu">secondary menu</link>, if a menu is required.</p></item>
<item><p>When used in combination with a <link xref="sidebar-lists">sidebar list</link>, the primary menu should be placed above the sidebar list on the right. If a menu is required for items shown in the content side of the window, a <link xref="secondary-menu">secondary menu</link> can be used.</p></item>
</list>

<p>Other guidelines:</p>

<list>
<item><p>Primärmenyer kan innehålla objekt för både det aktuella fönstret och vyn, så väl som programmet i stort. Detta särskiljer dem från <link xref="secondary-menus">sekundärmenyer</link>, vilka bara innehåller menyobjekt som relaterar till en specifik vy eller objekt.</p></item>
<item><p>Följ <link xref="menus">standardriktlinjerna för menyer</link> när du bestämmer innehåll och ordning för primärmenyer.</p></item>
<item><p>A primary menu is contained within a <link xref="popovers">popover</link>. As such, a primary menu can include a variety of controls, such as groups of buttons.</p></item>
</list>

</section>

<section id="standard-menu-items">
<title>Standardmenyobjekt</title>

<p>The following are standard primary menu items, and should be placed in a group at the end of the menu:</p>

<table>
<tr>
<td><p><gui>Inställningar</gui></p></td>
<td><p>Opens the application's preferences dialog, if it has one.</p></td>
</tr>
<tr>
<td><p><gui>Keyboard Shortcuts</gui></p></td>
<td><p>Opens the application's keyboard shortcuts window, if it has one.</p></td>
</tr>
<tr>
<td><p><gui>Hjälp</gui></p></td>
<td><p>Opens the application's user documentation in the <app>Help</app> application.</p></td>
</tr>
<tr>
<td><p><gui>About Application</gui></p></td>
<td><p>Opens the application's about dialog. This item should include the application's name, such as <gui>About Photos</gui> or <gui>About Calculator</gui>. Every primary menu should include this item.</p></td>
</tr>
</table>

<p>Primärmenyer bör inte innehålla menyobjekt för att stänga eller avsluta. Fönster kan redan stängas från rubrikraden, och det kan vara tvetydigt vad ett menyobjekt för stängning hänvisar till. Användare kan ha svårt att hålla isär stäng och avsluta, och det kan därför vara missledande.</p>

</section>

<section id="api-reference">
<title>API-referens</title>

<list>
<item><p><link href="https://developer.gnome.org/gtk3/stable/GtkMenuButton.html">GtkMenuButton</link></p></item>
<item><p><link href="https://developer.gnome.org/gtk3/stable/GtkPopoverMenu.html">GtkPopoverMenu</link></p></item>
</list>

</section>

</page>
