Bug 456535 - On Windows, users should be able to hide the menubar and show it with the alt key. r=mano, ui-r=faaborg

This commit is contained in:
Dão Gottwald 2009-06-13 08:08:20 +02:00
Родитель 902256e07f
Коммит de0f0618ec
3 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -4530,14 +4530,15 @@ function onViewToolbarsPopupShowing(aEvent)
for (i = 0; i < gNavToolbox.childNodes.length; ++i) {
var toolbar = gNavToolbox.childNodes[i];
var toolbarName = toolbar.getAttribute("toolbarname");
var type = toolbar.getAttribute("type");
if (toolbarName && type != "menubar") {
var menuItem = document.createElement("menuitem");
if (toolbarName) {
let menuItem = document.createElement("menuitem");
let hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
"autohide" : "collapsed";
menuItem.setAttribute("toolbarindex", i);
menuItem.setAttribute("type", "checkbox");
menuItem.setAttribute("label", toolbarName);
menuItem.setAttribute("accesskey", toolbar.getAttribute("accesskey"));
menuItem.setAttribute("checked", toolbar.getAttribute("collapsed") != "true");
menuItem.setAttribute("checked", toolbar.getAttribute(hidingAttribute) != "true");
popup.insertBefore(menuItem, firstMenuItem);
menuItem.addEventListener("command", onViewToolbarCommand, false);
@ -4550,9 +4551,12 @@ function onViewToolbarCommand(aEvent)
{
var index = aEvent.originalTarget.getAttribute("toolbarindex");
var toolbar = gNavToolbox.childNodes[index];
var hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
"autohide" : "collapsed";
toolbar.collapsed = aEvent.originalTarget.getAttribute("checked") != "true";
document.persist(toolbar.id, "collapsed");
toolbar.setAttribute(hidingAttribute,
aEvent.originalTarget.getAttribute("checked") != "true");
document.persist(toolbar.id, hidingAttribute);
}
function displaySecurityInfo()

Просмотреть файл

@ -284,6 +284,10 @@
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
defaultset="menubar-items"
mode="icons" iconsize="small" defaulticonsize="small"
#ifdef XP_WIN
toolbarname="&menubarCmd.label;"
accesskey="&menubarCmd.accesskey;"
#endif
context="toolbar-context-menu">
<toolbaritem id="menubar-items" align="center">
# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by

Просмотреть файл

@ -32,6 +32,8 @@
<!ENTITY goOfflineCmd.label "Work Offline">
<!ENTITY goOfflineCmd.accesskey "w">
<!ENTITY menubarCmd.label "Menu Bar">
<!ENTITY menubarCmd.accesskey "M">
<!ENTITY navbarCmd.label "Navigation Toolbar">
<!ENTITY navbarCmd.accesskey "N">
<!ENTITY personalbarCmd.label "Bookmarks Toolbar">