browser/components/customizableui/content/panelUI.inc.xul
author Mike de Boer <mdeboer@mozilla.com>
Tue, 30 May 2017 14:21:59 +0200
changeset 409430 db14c0e392d03d81a229bc2e68325f27d6cf0e41
parent 409106 1ff36fd8109735209ac0888d30e1ffbf37a20076
child 409724 75cd29c89c8c72e9477a18464d7bf993912337bd
permissions -rw-r--r--
Bug 1364738 - Fix up multi-line labels inside panelviews that have wrapped around and align elements in the banner. r=Gijs,Paolo I updated, extended and refined Paolo's descriptionHeightWorkaround method to support multi-line toolbar button labels. Made the app menu use that method to ensure no scrollbars appear. Also updated the styling of the banner to have icon and label align correctly with those of the other buttons inside the panelview. MozReview-Commit-ID: IzbahG0kyTu

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<panel id="PanelUI-popup"
       role="group"
       type="arrow"
       hidden="true"
       flip="slide"
       position="bottomcenter topright"
       noautofocus="true">
  <panelmultiview id="PanelUI-multiView" mainViewId="PanelUI-mainView">
    <panelview id="PanelUI-mainView" context="customizationPanelContextMenu">
      <vbox id="PanelUI-contents-scroller">
        <vbox id="PanelUI-contents" class="panelUI-grid"/>
      </vbox>

      <footer id="PanelUI-footer">
        <vbox id="PanelUI-footer-addons"></vbox>
        <toolbarbutton class="panel-banner-item"
                       label-update-available="&updateAvailable.panelUI.label;"
                       label-update-manual="&updateManual.panelUI.label;"
                       label-update-restart="&updateRestart.panelUI.label2;"
                       oncommand="PanelUI._onBannerItemSelected(event)"
                       wrap="true"
                       hidden="true"/>
        <hbox id="PanelUI-fxa-container">
          <hbox id="PanelUI-fxa-status"
                label="&fxaSignedIn.tooltip;"
                defaultlabel="&fxaSignIn.label;"
                signedinTooltiptext="&fxaSignedIn.tooltip;"
                tooltiptext="&fxaSignedIn.tooltip;"
                errorlabel="&fxaSignInError.label;"
                unverifiedlabel="&fxaUnverified.label;"
                onclick="if (event.which == 1) gSync.onMenuPanelCommand();">
            <image id="PanelUI-fxa-avatar"/>
            <toolbarbutton id="PanelUI-fxa-label"
                           label="&fxaSignIn.label;"
                           fxabrandname="&syncBrand.fxAccount.label;"/>
          </hbox>
          <toolbarseparator/>
          <toolbarbutton id="PanelUI-fxa-icon"
                         oncommand="gSync.doSync();"
                         closemenu="none">
            <observes element="sync-status" attribute="syncstatus"/>
            <observes element="sync-status" attribute="tooltiptext"/>
          </toolbarbutton>
        </hbox>

        <hbox id="PanelUI-footer-inner">
          <toolbarbutton id="PanelUI-customize" label="&appMenuCustomize.label;"
                         exitLabel="&appMenuCustomizeExit.label;"
                         tooltiptext="&appMenuCustomize.tooltip;"
                         exitTooltiptext="&appMenuCustomizeExit.tooltip;"
                         closemenu="none"
                         oncommand="gCustomizeMode.toggle();"/>
          <toolbarseparator/>
          <toolbarbutton id="PanelUI-help" label="&helpMenu.label;"
                         closemenu="none"
                         tooltiptext="&appMenuHelp.tooltip;"
                         oncommand="PanelUI.showHelpView(this);"/>
          <toolbarseparator/>
          <toolbarbutton id="PanelUI-quit"
#ifdef XP_WIN
                         label="&quitApplicationCmdWin2.label;"
                         tooltiptext="&quitApplicationCmdWin2.tooltip;"
#else
#ifdef XP_MACOSX
                         label="&quitApplicationCmdMac2.label;"
#else
                         label="&quitApplicationCmd.label;"
#endif
#endif
                         command="cmd_quitApplication"/>
        </hbox>
      </footer>
    </panelview>

    <panelview id="PanelUI-history" flex="1">
      <label value="&appMenuHistory.label;" class="panel-subview-header"/>
      <vbox class="panel-subview-body">
        <toolbarbutton id="appMenuViewHistorySidebar"
                       label="&appMenuHistory.viewSidebar.label;"
                       type="checkbox"
                       class="subviewbutton"
                       key="key_gotoHistory"
                       oncommand="SidebarUI.toggle('viewHistorySidebar'); PanelUI.hide();">
          <observes element="viewHistorySidebar" attribute="checked"/>
        </toolbarbutton>
        <toolbarbutton id="appMenuClearRecentHistory"
                       label="&appMenuHistory.clearRecent.label;"
                       class="subviewbutton"
                       command="Tools:Sanitize"/>
        <toolbarbutton id="appMenuRestoreLastSession"
                       label="&appMenuHistory.restoreSession.label;"
                       class="subviewbutton"
                       command="Browser:RestoreLastSession"/>
        <menuseparator id="PanelUI-recentlyClosedTabs-separator"/>
        <vbox id="PanelUI-recentlyClosedTabs" tooltip="bhTooltip"/>
        <menuseparator id="PanelUI-recentlyClosedWindows-separator"/>
        <vbox id="PanelUI-recentlyClosedWindows" tooltip="bhTooltip"/>
        <menuseparator id="PanelUI-historyItems-separator"/>
        <vbox id="PanelUI-historyItems" tooltip="bhTooltip"/>
      </vbox>
      <toolbarbutton id="PanelUI-historyMore"
                     class="panel-subview-footer subviewbutton"
                     label="&appMenuHistory.showAll.label;"
                     oncommand="PlacesCommandHook.showPlacesOrganizer('History'); CustomizableUI.hidePanelForNode(this);"/>
    </panelview>

    <panelview id="PanelUI-remotetabs" flex="1" class="PanelUI-subView">
      <label value="&appMenuRemoteTabs.label;" class="panel-subview-header"/>
      <vbox class="panel-subview-body">
        <!-- this widget has 3 boxes in the body, but only 1 is ever visible -->
        <!-- When Sync is ready to sync -->
        <vbox id="PanelUI-remotetabs-main" observes="sync-syncnow-state">
          <vbox id="PanelUI-remotetabs-buttons">
            <toolbarbutton id="PanelUI-remotetabs-view-sidebar"
                           class="subviewbutton"
                           observes="viewTabsSidebar"
                           label="&appMenuRemoteTabs.sidebar.label;"/>
            <toolbarbutton id="PanelUI-remotetabs-view-managedevices"
                           class="subviewbutton"
                           label="&appMenuRemoteTabs.managedevices.label;"
                           oncommand="gSync.openDevicesManagementPage('syncedtabs-menupanel');"/>
            <toolbarbutton id="PanelUI-remotetabs-syncnow"
                           observes="sync-status"
                           class="subviewbutton"
                           oncommand="gSync.doSync();"
                           closemenu="none"/>
            <menuseparator id="PanelUI-remotetabs-separator"/>
          </vbox>
          <deck id="PanelUI-remotetabs-deck">
            <!-- Sync is ready to Sync and the "tabs" engine is enabled -->
            <vbox id="PanelUI-remotetabs-tabspane">
              <vbox id="PanelUI-remotetabs-tabslist"
                    showAllLabel="&appMenuRemoteTabs.showAll.label;"
                    showAllTooltipText="&appMenuRemoteTabs.showAll.tooltip;"
                    showMoreLabel="&appMenuRemoteTabs.showMore.label;"
                    showMoreTooltipText="&appMenuRemoteTabs.showMore.tooltip;"
                    notabsforclientlabel="&appMenuRemoteTabs.notabs.label;"
                    />
            </vbox>
            <!-- Sync is ready to Sync but the "tabs" engine isn't enabled-->
            <hbox id="PanelUI-remotetabs-tabsdisabledpane" pack="center" flex="1">
              <vbox class="PanelUI-remotetabs-instruction-box" align="center">
                <hbox pack="center">
                  <html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
                </hbox>
                <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.tabsnotsyncing.label;</label>
                <hbox pack="center">
                  <toolbarbutton class="PanelUI-remotetabs-prefs-button"
                                 label="&appMenuRemoteTabs.openprefs.label;"
                                 oncommand="gSync.openPrefs('synced-tabs');"/>
                </hbox>
              </vbox>
            </hbox>
            <!-- Sync is ready to Sync but we are still fetching the tabs to show -->
            <vbox id="PanelUI-remotetabs-fetching">
              <!-- Show intentionally blank panel, see bug 1239845 -->
            </vbox>
            <!-- Sync has only 1 (ie, this) device connected -->
            <hbox id="PanelUI-remotetabs-nodevicespane" pack="center" flex="1">
              <vbox class="PanelUI-remotetabs-instruction-box">
                <hbox pack="center">
                  <html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
                </hbox>
                <label class="PanelUI-remotetabs-instruction-title">&appMenuRemoteTabs.noclients.title;</label>
                <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.noclients.subtitle;</label>
                <!-- The inner HTML for PanelUI-remotetabs-mobile-promo is built at runtime -->
                <label id="PanelUI-remotetabs-mobile-promo" fxAccountsBrand="&syncBrand.fxAccount.label;"/>
              </vbox>
            </hbox>
          </deck>
        </vbox>
        <!-- a box to ensure contained boxes are centered horizonally -->
        <hbox pack="center" flex="1">
          <!-- When Sync is not configured -->
          <vbox id="PanelUI-remotetabs-setupsync"
                flex="1"
                align="center"
                class="PanelUI-remotetabs-instruction-box"
                observes="sync-setup-state">
            <html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
            <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label>
            <toolbarbutton class="PanelUI-remotetabs-prefs-button"
                           label="&appMenuRemoteTabs.signin.label;"
                           oncommand="gSync.openPrefs('synced-tabs');"/>
          </vbox>
          <!-- When Sync needs re-authentication. This uses the exact same messaging
               as "Sync is not configured" but remains a separate box so we get
               the goodness of observing broadcasters to manage the hidden states -->
          <vbox id="PanelUI-remotetabs-reauthsync"
                flex="1"
                align="center"
                class="PanelUI-remotetabs-instruction-box"
                observes="sync-reauth-state">
            <html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
            <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label>
            <toolbarbutton class="PanelUI-remotetabs-prefs-button"
                           label="&appMenuRemoteTabs.signin.label;"
                           oncommand="gSync.openPrefs('synced-tabs');"/>
          </vbox>
        </hbox>
      </vbox>
    </panelview>

    <panelview id="PanelUI-bookmarks" flex="1" class="PanelUI-subView">
      <label value="&bookmarksMenu.label;" class="panel-subview-header"/>
      <vbox class="panel-subview-body">
        <toolbarbutton id="panelMenuBookmarkThisPage"
                       class="subviewbutton"
                       observes="bookmarkThisPageBroadcaster"
                       command="Browser:AddBookmarkAs"
                       onclick="PanelUI.hide();"/>
        <toolbarseparator/>
        <toolbarbutton id="panelMenu_viewBookmarksSidebar"
                       label="&viewBookmarksSidebar2.label;"
                       class="subviewbutton"
                       key="viewBookmarksSidebarKb"
                       oncommand="SidebarUI.toggle('viewBookmarksSidebar'); PanelUI.hide();">
          <observes element="viewBookmarksSidebar" attribute="checked"/>
        </toolbarbutton>
        <toolbarbutton id="panelMenu_viewBookmarksToolbar"
                       label="&viewBookmarksToolbar.label;"
                       type="checkbox"
                       toolbarId="PersonalToolbar"
                       class="subviewbutton"
                       oncommand="onViewToolbarCommand(event); PanelUI.hide();"/>
        <toolbarseparator/>
        <toolbarbutton id="panelMenu_bookmarksToolbar"
                       label="&personalbarCmd.label;"
                       class="subviewbutton cui-withicon"
                       oncommand="PlacesCommandHook.showPlacesOrganizer('BookmarksToolbar'); PanelUI.hide();"/>
        <toolbarbutton id="panelMenu_unsortedBookmarks"
                       label="&otherBookmarksCmd.label;"
                       class="subviewbutton cui-withicon"
                       oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks'); PanelUI.hide();"/>
        <toolbarseparator class="small-separator"/>
        <toolbaritem id="panelMenu_bookmarksMenu"
                     orient="vertical"
                     smoothscroll="false"
                     onclick="if (event.button == 1) BookmarkingUI.onPanelMenuViewCommand(event, this._placesView);"
                     oncommand="BookmarkingUI.onPanelMenuViewCommand(event, this._placesView);"
                     flatList="true"
                     tooltip="bhTooltip">
          <!-- bookmarks menu items will go here -->
        </toolbaritem>
      </vbox>
      <toolbarbutton id="panelMenu_showAllBookmarks"
                     label="&showAllBookmarks2.label;"
                     class="subviewbutton panel-subview-footer"
                     command="Browser:ShowAllBookmarks"
                     onclick="PanelUI.hide();"/>
    </panelview>

    <panelview id="PanelUI-socialapi" flex="1"/>

    <panelview id="PanelUI-feeds" flex="1" oncommand="FeedHandler.subscribeToFeed(null, event);">
      <label value="&feedsMenu2.label;" class="panel-subview-header"/>
    </panelview>

    <panelview id="PanelUI-containers" flex="1">
      <label value="&containersMenu.label;" class="panel-subview-header"/>
      <vbox id="PanelUI-containersItems"/>
    </panelview>

    <panelview id="PanelUI-helpView" flex="1" class="PanelUI-subView">
      <label value="&helpMenu.label;" class="panel-subview-header"/>
      <vbox id="PanelUI-helpItems" class="panel-subview-body"/>
    </panelview>

    <panelview id="PanelUI-developer" flex="1">
      <label value="&webDeveloperMenu.label;" class="panel-subview-header"/>
      <vbox id="PanelUI-developerItems" class="panel-subview-body"/>
    </panelview>

    <panelview id="PanelUI-sidebar" flex="1">
      <label value="&appMenuSidebars.label;" class="panel-subview-header"/>
      <vbox id="PanelUI-sidebarItems" class="panel-subview-body"/>
    </panelview>

    <panelview id="PanelUI-characterEncodingView" flex="1">
      <label value="&charsetMenu2.label;" class="panel-subview-header"/>
      <vbox class="panel-subview-body">
        <vbox id="PanelUI-characterEncodingView-pinned"
              class="PanelUI-characterEncodingView-list"/>
        <toolbarseparator/>
        <vbox id="PanelUI-characterEncodingView-charsets"
              class="PanelUI-characterEncodingView-list"/>
        <toolbarseparator/>
        <vbox>
          <label id="PanelUI-characterEncodingView-autodetect-label"/>
          <vbox id="PanelUI-characterEncodingView-autodetect"
                class="PanelUI-characterEncodingView-list"/>
        </vbox>
      </vbox>
    </panelview>

    <panelview id="PanelUI-panicView" flex="1">
      <vbox class="panel-subview-body">
        <hbox id="PanelUI-panic-timeframe">
          <image id="PanelUI-panic-timeframe-icon" alt=""/>
          <vbox flex="1">
            <hbox id="PanelUI-panic-header">
              <image id="PanelUI-panic-timeframe-icon-small" alt=""/>
              <description id="PanelUI-panic-mainDesc" flex="1">&panicButton.view.mainTimeframeDesc;</description>
            </hbox>
            <radiogroup id="PanelUI-panic-timeSpan" aria-labelledby="PanelUI-panic-mainDesc" closemenu="none">
              <radio id="PanelUI-panic-5min" label="&panicButton.view.5min;" selected="true"
                     value="5" class="subviewradio"/>
              <radio id="PanelUI-panic-2hr" label="&panicButton.view.2hr;"
                     value="2" class="subviewradio"/>
              <radio id="PanelUI-panic-day" label="&panicButton.view.day;"
                     value="6" class="subviewradio"/>
            </radiogroup>
          </vbox>
        </hbox>
        <vbox id="PanelUI-panic-explanations">
          <label id="PanelUI-panic-actionlist-main-label">&panicButton.view.mainActionDesc;</label>

          <label id="PanelUI-panic-actionlist-windows" class="PanelUI-panic-actionlist">&panicButton.view.deleteTabsAndWindows;</label>
          <label id="PanelUI-panic-actionlist-cookies" class="PanelUI-panic-actionlist">&panicButton.view.deleteCookies;</label>
          <label id="PanelUI-panic-actionlist-history" class="PanelUI-panic-actionlist">&panicButton.view.deleteHistory;</label>
          <label id="PanelUI-panic-actionlist-newwindow" class="PanelUI-panic-actionlist">&panicButton.view.openNewWindow;</label>

          <label id="PanelUI-panic-warning">&panicButton.view.undoWarning;</label>
        </vbox>
        <button id="PanelUI-panic-view-button"
                label="&panicButton.view.forgetButton;"/>
      </vbox>
    </panelview>

  </panelmultiview>
</panel>

<panel id="widget-overflow"
       role="group"
       type="arrow"
       noautofocus="true"
       position="bottomcenter topright"
       hidden="true">
  <panelmultiview mainViewId="widget-overflow-mainView">
    <panelview id="widget-overflow-mainView"
               context="toolbar-context-menu">
      <vbox id="widget-overflow-scroller">
        <vbox id="widget-overflow-list" class="widget-overflow-list"
              overflowfortoolbar="nav-bar"/>
        <toolbarseparator id="widget-overflow-fixed-separator" hidden="true"/>
        <vbox id="widget-overflow-fixed-list" class="widget-overflow-list" hidden="true"/>
      </vbox>
    </panelview>
  </panelmultiview>
</panel>

<panel id="customization-tipPanel"
       type="arrow"
       flip="none"
       side="left"
       position="leftcenter topright"
       noautohide="true"
       hidden="true">
  <hbox class="customization-tipPanel-wrapper">
    <vbox class="customization-tipPanel-infoBox"/>
    <vbox class="customization-tipPanel-content" flex="1">
      <description class="customization-tipPanel-contentMessage"/>
      <image class="customization-tipPanel-contentImage"/>
    </vbox>
    <vbox pack="start" align="end" class="customization-tipPanel-closeBox">
      <toolbarbutton oncommand="gCustomizeMode.hideTip()" class="close-icon"/>
    </vbox>
  </hbox>
</panel>

<panel id="panic-button-success-notification"
       type="arrow"
       position="bottomcenter topright"
       hidden="true"
       role="alert"
       orient="vertical">
  <hbox id="panic-button-success-header">
    <image id="panic-button-success-icon" alt=""/>
    <vbox>
      <description>&panicButton.thankyou.msg1;</description>
      <description>&panicButton.thankyou.msg2;</description>
    </vbox>
  </hbox>
  <button label="&panicButton.thankyou.buttonlabel;"
          id="panic-button-success-closebutton"
          oncommand="PanicButtonNotifier.close()"/>
</panel>

<panel id="appMenu-notification-popup"
       class="popup-notification-panel"
       type="arrow"
       position="after_start"
       hidden="true"
       flip="slide"
       orient="vertical"
       noautofocus="true"
       noautohide="true"
       nopreventnavboxhide="true"
       role="alert">
  <popupnotification id="appMenu-update-available-notification"
                     popupid="update-available"
                     label="&updateAvailable.header.message;"
                     buttonlabel="&updateAvailable.acceptButton.label;"
                     buttonaccesskey="&updateAvailable.acceptButton.accesskey;"
                     closebuttonhidden="true"
                     secondarybuttonlabel="&updateAvailable.cancelButton.label;"
                     secondarybuttonaccesskey="&updateAvailable.cancelButton.accesskey;"
                     dropmarkerhidden="true"
                     checkboxhidden="true"
                     hidden="true">
    <popupnotificationcontent id="update-available-notification-content" orient="vertical">
      <description id="update-available-description">&updateAvailable.message;
        <label id="update-available-whats-new" class="text-link" value="&updateAvailable.whatsnew.label;" />
      </description>
    </popupnotificationcontent>
  </popupnotification>

  <popupnotification id="appMenu-update-manual-notification"
                     popupid="update-manual"
                     label="&updateManual.header.message;"
                     buttonlabel="&updateManual.acceptButton.label;"
                     buttonaccesskey="&updateManual.acceptButton.accesskey;"
                     closebuttonhidden="true"
                     secondarybuttonlabel="&updateManual.cancelButton.label;"
                     secondarybuttonaccesskey="&updateManual.cancelButton.accesskey;"
                     dropmarkerhidden="true"
                     checkboxhidden="true"
                     hidden="true">
    <popupnotificationcontent id="update-manual-notification-content" orient="vertical">
      <description id="update-manual-description">&updateManual.message;
        <label id="update-manual-whats-new" class="text-link" value="&updateManual.whatsnew.label;" />
      </description>
    </popupnotificationcontent>
  </popupnotification>

  <popupnotification id="appMenu-update-restart-notification"
                     popupid="update-restart"
                     label="&updateRestart.header.message2;"
                     buttonlabel="&updateRestart.acceptButton.label;"
                     buttonaccesskey="&updateRestart.acceptButton.accesskey;"
                     closebuttonhidden="true"
                     secondarybuttonlabel="&updateRestart.cancelButton.label;"
                     secondarybuttonaccesskey="&updateRestart.cancelButton.accesskey;"
                     dropmarkerhidden="true"
                     checkboxhidden="true"
                     hidden="true">
    <popupnotificationcontent id="update-restart-notification-content" orient="vertical">
      <description id="update-restart-description">&updateRestart.message;</description>
    </popupnotificationcontent>
  </popupnotification>
</panel>

<menupopup id="customizationPanelItemContextMenu">
  <menuitem oncommand="gCustomizeMode.addToToolbar(document.popupNode)"
            closemenu="single"
            class="customize-context-moveToToolbar"
            photonaccesskey="&customizeMenu.unpinFromOverflowMenu.accesskey;"
            photonlabel="&customizeMenu.unpinFromOverflowMenu.label;"
            accesskey="&customizeMenu.moveToToolbar.accesskey;"
            label="&customizeMenu.moveToToolbar.label;"/>
  <menuitem oncommand="gCustomizeMode.removeFromArea(document.popupNode)"
            closemenu="single"
            class="customize-context-removeFromPanel"
            photonaccesskey="&customizeMenu.removeFromToolbar.accesskey;"
            photonlabel="&customizeMenu.removeFromToolbar.label;"
            accesskey="&customizeMenu.removeFromMenu.accesskey;"
            label="&customizeMenu.removeFromMenu.label;"/>
  <menuseparator/>
  <menuitem command="cmd_CustomizeToolbars"
            class="viewCustomizeToolbar"
            accesskey="&viewCustomizeToolbar.accesskey;"
            label="&viewCustomizeToolbar.label;"/>
</menupopup>

<menupopup id="customizationPaletteItemContextMenu">
  <menuitem oncommand="gCustomizeMode.addToToolbar(document.popupNode)"
            class="customize-context-addToToolbar"
            accesskey="&customizeMenu.addToToolbar.accesskey;"
            label="&customizeMenu.addToToolbar.label;"/>
  <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)"
            class="customize-context-addToPanel"
            photonaccesskey="&customizeMenu.addToOverflowMenu.accesskey;"
            photonlabel="&customizeMenu.addToOverflowMenu.label;"
            accesskey="&customizeMenu.addToPanel.accesskey;"
            label="&customizeMenu.addToPanel.label;"/>
</menupopup>

<menupopup id="customizationPanelContextMenu">
  <menuitem command="cmd_CustomizeToolbars"
            accesskey="&customizeMenu.addMoreItems.accesskey;"
            label="&customizeMenu.addMoreItems.label;"/>
</menupopup>

<panel id="appMenu-popup"
       class="cui-widget-panel"
       role="group"
       type="arrow"
       hidden="true"
       flip="slide"
       position="bottomcenter topright"
       noautofocus="true">
  <photonpanelmultiview id="appMenu-multiView" mainViewId="appMenu-mainView" descriptionheightworkaround="true">
    <panelview id="appMenu-mainView" class="PanelUI-subView">
      <vbox class="panel-subview-body">
        <vbox id="appMenu-addon-banners"/>
        <toolbarbutton class="panel-banner-item"
                       label-update-available="&updateAvailable.panelUI.label;"
                       label-update-manual="&updateManual.panelUI.label;"
                       label-update-restart="&updateRestart.panelUI.label2;"
                       oncommand="PanelUI._onBannerItemSelected(event)"
                       wrap="true"
                       hidden="true"/>
        <toolbaritem id="appMenu-fxa-container">
          <hbox id="appMenu-fxa-status"
                flex="1"
                defaultlabel="&fxaSignIn.label;"
                signedinTooltiptext="&fxaSignedIn.tooltip;"
                tooltiptext="&fxaSignedIn.tooltip;"
                errorlabel="&fxaSignInError.label;"
                unverifiedlabel="&fxaUnverified.label;"
                onclick="if (event.which == 1) gSync.onMenuPanelCommand();">
            <image id="appMenu-fxa-avatar"/>
            <toolbarbutton id="appMenu-fxa-label"
                           class="subviewbutton subviewbutton-iconic"
                           label="&fxaSignIn.label;"
                           fxabrandname="&syncBrand.fxAccount.label;"/>
          </hbox>
          <toolbarseparator/>
          <toolbarbutton id="appMenu-fxa-icon"
                         class="subviewbutton subviewbutton-iconic"
                         oncommand="gSync.doSync();"
                         closemenu="none">
            <observes element="sync-status" attribute="syncstatus"/>
            <observes element="sync-status" attribute="tooltiptext"/>
          </toolbarbutton>
        </toolbaritem>
        <toolbarseparator/>
        <toolbarbutton id="appMenu-new-window-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&newNavigatorCmd.label;"
                       key="key_newNavigator"
                       command="cmd_newNavigator"/>
        <toolbarbutton id="appMenu-private-window-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&newPrivateWindow.label;"
                       key="key_privatebrowsing"
                       command="Tools:PrivateBrowsing"/>
        <toolbarseparator/>
        <toolbaritem id="appMenu-edit-controls" class="toolbaritem-combined-buttons" closemenu="none">
          <label value="&editMenu.label;"/>
          <toolbarbutton id="appMenu-cut-button"
                         class="subviewbutton subviewbutton-iconic"
                         command="cmd_cut"
                         tooltip="dynamic-shortcut-tooltip"/>
          <toolbarbutton id="appMenu-copy-button"
                         class="subviewbutton subviewbutton-iconic"
                         command="cmd_copy"
                         tooltip="dynamic-shortcut-tooltip"/>
          <toolbarbutton id="appMenu-paste-button"
                         class="subviewbutton subviewbutton-iconic"
                         command="cmd_paste"
                         tooltip="dynamic-shortcut-tooltip"/>
        </toolbaritem>
        <toolbarseparator/>
        <toolbarbutton id="appMenu-open-file-button"
                       class="subviewbutton"
                       label="&openFileCmd.label;"
                       key="openFileKb"
                       command="Browser:OpenFile"
                       />
        <toolbarbutton id="appMenu-save-file-button"
                       class="subviewbutton"
                       label="&savePageCmd.label;"
                       key="key_savePage"
                       command="Browser:SavePage"
                       />
        <toolbarbutton id="appMenu-page-setup-button"
                       class="subviewbutton"
                       label="&printSetupCmd.label;"
                       command="cmd_pageSetup"
                       />
        <toolbarbutton id="appMenu-print-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&printButton.label;"
                       key="printKb"
#ifdef XP_MACOSX
                       command="cmd_print"
#else
                       command="cmd_printPreview"
#endif
                       />
        <toolbarseparator/>
        <toolbarbutton id="appMenu-library-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&places.library.title;"
                       command="Browser:ShowAllBookmarks"
                       />
        <toolbarbutton id="appMenu-addons-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&addons.label;"
                       key="key_openAddons"
                       command="Tools:Addons"
                       />
        <toolbarbutton id="appMenu-preferences-button"
                       class="subviewbutton subviewbutton-iconic"
#ifdef XP_WIN
                       label="&preferencesCmd2.label;"
#else
                       label="&preferencesCmdUnix.label;"
#ifdef XP_MACOSX
                       key="key_preferencesCmdMac"
#endif
#endif
                       oncommand="openPreferences()"
                       />
        <toolbarbutton id="appMenu-customize-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&viewCustomizeToolbar.label;"
                       command="cmd_CustomizeToolbars"
                       />
        <toolbarseparator/>
        <toolbarbutton id="appMenu-find-button"
                       class="subviewbutton subviewbutton-iconic"
                       label="&findOnCmd.label;"
                       key="key_find"
                       command="cmd_find"/>
        <toolbarbutton id="appMenu-more-button"
                       class="subviewbutton subviewbutton-nav"
                       label="&moreMenu.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('appMenu-moreView', this)"/>
        <toolbarbutton id="appMenu-developer-button"
                       class="subviewbutton subviewbutton-nav"
                       label="&webDeveloperMenu.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('PanelUI-developer', this, null, true)"/>
        <toolbarbutton id="appMenu-help-button"
                       class="subviewbutton subviewbutton-iconic subviewbutton-nav"
                       label="&appMenuHelp.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('PanelUI-helpView', this, null, true)"/>
      </vbox>
    </panelview>
    <panelview id="appMenu-moreView" title="&moreMenu.label;" class="PanelUI-subView">
      <vbox class="panel-subview-body">
        <toolbarbutton id="appMenu-characterencoding-button"
                       class="subviewbutton subviewbutton-nav"
                       label="&charsetMenu2.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('PanelUI-characterEncodingView', this, null, true)"/>
        <toolbarbutton id="appMenu-workoffline-button"
                       class="subviewbutton"
                       label="&goOfflineCmd.label;"
                       type="checkbox"
                       observes="workOfflineMenuitemState"
                       oncommand="BrowserOffline.toggleOfflineStatus();"/>
      </vbox>
    </panelview>
  </photonpanelmultiview>
</panel>