Bug 589139: Keyboard short-cuts missing from Firefox button menu items. r=gavin.sharp, a=blocking-b6

This commit is contained in:
Margaret Leibovic 2010-09-07 13:37:04 -07:00
Родитель 01c1c05030
Коммит 97df4ffb94
3 изменённых файлов: 78 добавлений и 26 удалений

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

@ -133,6 +133,16 @@ toolbar[mode="icons"] > #reload-button[displaystop] {
display: none; display: none;
} }
.menuitem-tooltip {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-tooltip");
}
.menuitem-iconic-tooltip,
.menuitem-tooltip[type="checkbox"],
.menuitem-tooltip[type="radio"] {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
}
/* ::::: location bar ::::: */ /* ::::: location bar ::::: */
#urlbar { #urlbar {
-moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar); -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);

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

@ -451,32 +451,37 @@
<vbox id="appmenuPrimaryPane"> <vbox id="appmenuPrimaryPane">
<hbox flex="1" <hbox flex="1"
class="split-menuitem"> class="split-menuitem">
<menuitem id="appmenu_newTab" <menuitem id="menuitem-tooltip appmenu_newTab"
class="split-menuitem-item" class="split-menuitem-item"
flex="1" flex="1"
label="&tabCmd.label;" label="&tabCmd.label;"
command="cmd_newNavigatorTab"/> command="cmd_newNavigatorTab"
key="key_newNavigatorTab"/>
<menu class="split-menuitem-menu"> <menu class="split-menuitem-menu">
<menupopup> <menupopup>
<menuitem id="appmenu_newTab_popup" <menuitem id="appmenu_newTab_popup"
label="&tabCmd.label;" label="&tabCmd.label;"
command="cmd_newNavigatorTab"/> command="cmd_newNavigatorTab"
key="key_newNavigatorTab"/>
<menuitem id="appmenu_newNavigator" <menuitem id="appmenu_newNavigator"
label="&newNavigatorCmd.label;" label="&newNavigatorCmd.label;"
command="cmd_newNavigator"/> command="cmd_newNavigator"
key="key_newNavigator"/>
<menuseparator/> <menuseparator/>
<menuitem id="appmenu_openFile" <menuitem id="appmenu_openFile"
label="&openFileCmd.label;" label="&openFileCmd.label;"
command="Browser:OpenFile"/> command="Browser:OpenFile"
key="openFileKb"/>
</menupopup> </menupopup>
</menu> </menu>
</hbox> </hbox>
<menuitem id="appmenu_privateBrowsing" <menuitem id="appmenu_privateBrowsing"
class="menuitem-iconic" class="menuitem-iconic menuitem-iconic-tooltip"
label="&privateBrowsingCmd.start.label;" label="&privateBrowsingCmd.start.label;"
startlabel="&privateBrowsingCmd.start.label;" startlabel="&privateBrowsingCmd.start.label;"
stoplabel="&privateBrowsingCmd.stop.label;" stoplabel="&privateBrowsingCmd.stop.label;"
command="Tools:PrivateBrowsing"/> command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
<menuseparator class="appmenu-menuseparator"/> <menuseparator class="appmenu-menuseparator"/>
<hbox class="split-menuitem"> <hbox class="split-menuitem">
<menuitem id="appmenu-edit-menuitem" <menuitem id="appmenu-edit-menuitem"
@ -499,22 +504,27 @@
tooltiptext="&pasteButton.tooltip;"/> tooltiptext="&pasteButton.tooltip;"/>
</hbox> </hbox>
<menuitem id="appmenu_find" <menuitem id="appmenu_find"
class="menuitem-tooltip"
label="&appMenuFind.label;" label="&appMenuFind.label;"
command="cmd_find"/> command="cmd_find"
key="key_find"/>
<menuseparator class="appmenu-menuseparator"/> <menuseparator class="appmenu-menuseparator"/>
<menuitem id="appmenu_savePage" <menuitem id="appmenu_savePage"
class="menuitem-tooltip"
label="&savePageCmd.label;" label="&savePageCmd.label;"
command="Browser:SavePage"/> command="Browser:SavePage"
key="key_savePage"/>
<menuitem id="appmenu_sendLink" <menuitem id="appmenu_sendLink"
label="&sendPageCmd.label;" label="&sendPageCmd.label;"
command="Browser:SendLink"/> command="Browser:SendLink"/>
<hbox flex="1" <hbox flex="1"
class="split-menuitem"> class="split-menuitem">
<menuitem id="appmenu_print" <menuitem id="appmenu_print"
class="menuitem-iconic split-menuitem-item" class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
flex="1" flex="1"
label="&printCmd.label;" label="&printCmd.label;"
command="cmd_print"/> command="cmd_print"
key="printKb"/>
<menu class="split-menuitem-menu"> <menu class="split-menuitem-menu">
<menupopup> <menupopup>
<menuitem id="appmenu_print_popup" <menuitem id="appmenu_print_popup"
@ -537,15 +547,18 @@
<menuitem id="appmenu_webConsole" <menuitem id="appmenu_webConsole"
label="&webConsoleCmd.label;" label="&webConsoleCmd.label;"
type="checkbox" type="checkbox"
oncommand="HUDConsoleUI.toggleHUD();"/> oncommand="HUDConsoleUI.toggleHUD();"
key="key_webConsole"/>
<menuitem id="appmenu_pageInspect" <menuitem id="appmenu_pageInspect"
label="&inspectMenu.label;" label="&inspectMenu.label;"
type="checkbox" type="checkbox"
command="Tools:Inspect"/> command="Tools:Inspect"
key="key_inspect"/>
<menuseparator/> <menuseparator/>
<menuitem id="appmenu_pageSource" <menuitem id="appmenu_pageSource"
label="&viewPageSourceCmd.label;" label="&viewPageSourceCmd.label;"
command="View:PageSource"/> command="View:PageSource"
key="key_viewSource"/>
<menuseparator/> <menuseparator/>
<menuitem label="&goOfflineCmd.label;" <menuitem label="&goOfflineCmd.label;"
type="checkbox" type="checkbox"
@ -554,9 +567,11 @@
</menu> </menu>
<menuseparator class="appmenu-menuseparator"/> <menuseparator class="appmenu-menuseparator"/>
<menuitem id="appmenu_fullScreen" <menuitem id="appmenu_fullScreen"
class="menuitem-tooltip"
label="&fullScreenCmd.label;" label="&fullScreenCmd.label;"
type="checkbox" type="checkbox"
observes="View:FullScreen"/> observes="View:FullScreen"
key="key_fullScreen"/>
<menuitem id="appmenu-quit" <menuitem id="appmenu-quit"
class="menuitem-iconic" class="menuitem-iconic"
#ifdef XP_WIN #ifdef XP_WIN
@ -569,10 +584,11 @@
<vbox id="appmenuSecondaryPane"> <vbox id="appmenuSecondaryPane">
<hbox class="split-menuitem"> <hbox class="split-menuitem">
<menuitem id="appmenu_bookmarks" <menuitem id="appmenu_bookmarks"
class="menuitem-iconic split-menuitem-item" class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
flex="1" flex="1"
label="&bookmarksMenu.label;" label="&bookmarksMenu.label;"
command="Browser:ShowAllBookmarks"/> command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menu id="appmenu_bookmarksMenu" <menu id="appmenu_bookmarksMenu"
class="split-menuitem-menu"> class="split-menuitem-menu">
<menupopup id="appmenu_bookmarksMenupopup" <menupopup id="appmenu_bookmarksMenupopup"
@ -595,9 +611,9 @@
class="menuitem-iconic"/> class="menuitem-iconic"/>
<menuitem id="appmenu_showAllBookmarks" <menuitem id="appmenu_showAllBookmarks"
label="&showAllBookmarks.label;" label="&showAllBookmarks.label;"
key="manBookmarkKb"
command="Browser:ShowAllBookmarks" command="Browser:ShowAllBookmarks"
context=""/> context=""
key="manBookmarkKb"/>
<menuseparator/> <menuseparator/>
<menuitem id="appmenu_bookmarkThisPage" <menuitem id="appmenu_bookmarkThisPage"
class="menuitem-iconic" class="menuitem-iconic"
@ -625,10 +641,11 @@
</hbox> </hbox>
<hbox class="split-menuitem"> <hbox class="split-menuitem">
<menuitem id="appmenu_history" <menuitem id="appmenu_history"
class="menuitem-iconic split-menuitem-item" class="menuitem-iconic menuitem-iconic-tooltip split-menuitem-item"
flex="1" flex="1"
label="&historyMenu.label;" label="&historyMenu.label;"
command="Browser:ShowAllHistory"/> command="Browser:ShowAllHistory"
key="showAllHistoryKb"/>
<menu id="appmenu_historyMenu" <menu id="appmenu_historyMenu"
class="split-menuitem-menu"> class="split-menuitem-menu">
<menupopup id="appmenu_historyMenupopup" <menupopup id="appmenu_historyMenupopup"
@ -641,8 +658,8 @@
popupsinherittooltip="true"> popupsinherittooltip="true">
<menuitem id="appmenu_showAllHistory" <menuitem id="appmenu_showAllHistory"
label="&showAllHistoryCmd2.label;" label="&showAllHistoryCmd2.label;"
key="showAllHistoryKb" command="Browser:ShowAllHistory"
command="Browser:ShowAllHistory"/> key="showAllHistoryKb"/>
<menuseparator/> <menuseparator/>
<menuitem id="appmenu_sanitizeHistory" <menuitem id="appmenu_sanitizeHistory"
label="&clearRecentHistory.label;" label="&clearRecentHistory.label;"
@ -668,13 +685,16 @@
</menu> </menu>
</hbox> </hbox>
<menuitem id="appmenu_downloads" <menuitem id="appmenu_downloads"
class="menuitem-tooltip"
label="&downloads.label;" label="&downloads.label;"
command="Tools:Downloads"/> command="Tools:Downloads"
key="key_openDownloads"/>
<spacer id="appmenuSecondaryPane-spacer"/> <spacer id="appmenuSecondaryPane-spacer"/>
<menuitem id="appmenu_addons" <menuitem id="appmenu_addons"
class="menuitem-iconic" class="menuitem-iconic menuitem-iconic-tooltip"
label="&addons.label;" label="&addons.label;"
command="Tools:Addons"/> command="Tools:Addons"
key="key_openAddons"/>
<hbox class="split-menuitem"> <hbox class="split-menuitem">
<menuitem id="appmenu_customize" <menuitem id="appmenu_customize"
label="&preferencesCmd.label;" label="&preferencesCmd.label;"

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

@ -721,4 +721,26 @@
]]></constructor> ]]></constructor>
</implementation> </implementation>
</binding> </binding>
<binding id="menuitem-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem">
<implementation>
<constructor><![CDATA[
this.setAttribute("tooltiptext", this.getAttribute("acceltext"));
// TODO: Simplify this to this.setAttribute("acceltext", "") once bug
// 592424 is fixed
document.getAnonymousElementByAttribute(this, "anonid", "accel").firstChild.setAttribute("value", "");
]]></constructor>
</implementation>
</binding>
<binding id="menuitem-iconic-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
<implementation>
<constructor><![CDATA[
this.setAttribute("tooltiptext", this.getAttribute("acceltext"));
// TODO: Simplify this to this.setAttribute("acceltext", "") once bug
// 592424 is fixed
document.getAnonymousElementByAttribute(this, "anonid", "accel").firstChild.setAttribute("value", "");
]]></constructor>
</implementation>
</binding>
</bindings> </bindings>