diff --git a/browser/base/Makefile.in b/browser/base/Makefile.in index 8cd20e6aa31a..b40ac585f6c4 100644 --- a/browser/base/Makefile.in +++ b/browser/base/Makefile.in @@ -78,3 +78,7 @@ ifneq ($(OS_ARCH),WINCE) DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1 endif endif + +ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT))) +DEFINES += -DMENUBAR_CAN_AUTOHIDE=1 +endif diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index d61cc992276d..f48962bc8952 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -210,9 +210,8 @@ - + accesskey="&viewToolbarsMenu.accesskey;"> + #reload-button[displaystop] { background-position: bottom left; } +.split-menuitem-menu > .menu-text, +.split-menuitem-menu > .menu-accel-container { + display: none; +} + /* ::::: location bar ::::: */ #urlbar { -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 76341cb899dc..fd0c6b28b10b 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1088,6 +1088,10 @@ function BrowserStartup() { goSetCommandEnabled("cmd_newNavigatorTab", false); } +#ifdef MENUBAR_CAN_AUTOHIDE + updateAppButtonDisplay(); +#endif + CombinedStopReload.init(); allTabs.readPref(); @@ -4545,9 +4549,11 @@ nsBrowserAccess.prototype = { } } -function onViewToolbarsPopupShowing(aEvent) -{ +function onViewToolbarsPopupShowing(aEvent) { var popup = aEvent.target; + if (popup != aEvent.currentTarget) + return; + var i; // Empty the menu @@ -4569,8 +4575,9 @@ function onViewToolbarsPopupShowing(aEvent) menuItem.setAttribute("toolbarindex", i); menuItem.setAttribute("type", "checkbox"); menuItem.setAttribute("label", toolbarName); - menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); menuItem.setAttribute("checked", toolbar.getAttribute(hidingAttribute) != "true"); + if (popup.id != "appmenu_customizeMenu") + menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey")); popup.insertBefore(menuItem, firstMenuItem); menuItem.addEventListener("command", onViewToolbarCommand, false); @@ -4579,8 +4586,7 @@ function onViewToolbarsPopupShowing(aEvent) } } -function onViewToolbarCommand(aEvent) -{ +function onViewToolbarCommand(aEvent) { var index = aEvent.originalTarget.getAttribute("toolbarindex"); var toolbar = gNavToolbox.childNodes[index]; var hidingAttribute = toolbar.getAttribute("type") == "menubar" ? @@ -4589,6 +4595,10 @@ function onViewToolbarCommand(aEvent) toolbar.setAttribute(hidingAttribute, aEvent.originalTarget.getAttribute("checked") != "true"); document.persist(toolbar.id, hidingAttribute); + +#ifdef MENUBAR_CAN_AUTOHIDE + updateAppButtonDisplay(); +#endif } var TabsOnTop = { @@ -4614,6 +4624,13 @@ var TabsOnTop = { } } +#ifdef MENUBAR_CAN_AUTOHIDE +function updateAppButtonDisplay() { + document.getElementById("appmenu-button-container").hidden = + document.getElementById("toolbar-menubar").getAttribute("autohide") != "true"; +} +#endif + function displaySecurityInfo() { BrowserPageInfo(null, "securityTab"); diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index f525ff1002c7..aeeedeac9444 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -380,6 +380,103 @@ +#ifdef MENUBAR_CAN_AUTOHIDE + + + +#endif + + + + + + + diff --git a/browser/themes/winstripe/browser/appmenu-dropmarker.png b/browser/themes/winstripe/browser/appmenu-dropmarker.png new file mode 100644 index 000000000000..27deaff72225 Binary files /dev/null and b/browser/themes/winstripe/browser/appmenu-dropmarker.png differ diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css index 5b8c621889f6..2d6145663738 100644 --- a/browser/themes/winstripe/browser/browser.css +++ b/browser/themes/winstripe/browser/browser.css @@ -100,6 +100,62 @@ statusbarpanel#statusbar-display { -moz-padding-start: 0; } +/* App menu button */ + +%ifndef WINSTRIPE_AERO +#appmenu-button-container { + background: ActiveCaption; +} + +#appmenu-button-container:-moz-window-inactive { + background: InactiveCaption; +} +%endif + +#appmenu-button { + -moz-appearance: none; + background-color: rgb(228,120,14); + background-image: -moz-linear-gradient(rgba(255,255,255,.7), + rgba(255,255,255,.4) 10%, + rgba(255,255,255,0) 50%); + background-clip: padding-box; + border: 1px solid rgba(0,0,0,.5); + -moz-border-radius: 4px; + -moz-box-shadow: 0 0 5px rgba(255,255,255,.5) inset; + color: white; + text-shadow: 0 0 2px #333; + font-weight: bold; + padding: .2em 2em; +} + +#appmenu-button:hover:not(:active):not([open]) { + background-color: rgb(248,140,34); +} + +#appmenu-button:hover:active, +#appmenu-button[open] { + background-image: -moz-linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.2) 10%, transparent 60%); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3) inset; +} + +#appmenu-button > .button-box { + border-style: none; + padding: 0; +} + +#appmenu-button > .button-box > .button-menu-dropmarker { + list-style-image: url(appmenu-dropmarker.png); + width: auto; + height: auto; + padding: 0; + margin: 0; + -moz-margin-start: .5em; +} + +#appmenu-button > menupopup > menuitem { + -moz-padding-end: 16px; +} + /* ::::: bookmark buttons ::::: */ toolbarbutton.bookmark-item { diff --git a/browser/themes/winstripe/browser/jar.mn b/browser/themes/winstripe/browser/jar.mn index b4157a27e04a..ae1b3d541870 100644 --- a/browser/themes/winstripe/browser/jar.mn +++ b/browser/themes/winstripe/browser/jar.mn @@ -9,6 +9,7 @@ browser.jar: skin/classic/browser/aboutSessionRestore-window-icon.png (aboutSessionRestore-window-icon.png) skin/classic/browser/aboutCertError.css (aboutCertError.css) skin/classic/browser/actionicon-tab.png + skin/classic/browser/appmenu-dropmarker.png * skin/classic/browser/browser.css (browser.css) * skin/classic/browser/engineManager.css (engineManager.css) skin/classic/browser/fullscreen-video.css @@ -93,6 +94,7 @@ browser.jar: skin/classic/aero/browser/aboutSessionRestore-window-icon.png (aboutSessionRestore-window-icon-aero.png) skin/classic/aero/browser/aboutCertError.css (aboutCertError.css) skin/classic/aero/browser/actionicon-tab.png (actionicon-tab.png) + skin/classic/aero/browser/appmenu-dropmarker.png * skin/classic/aero/browser/browser.css (browser-aero.css) * skin/classic/aero/browser/engineManager.css (engineManager.css) skin/classic/aero/browser/fullscreen-video.css