mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1199609 - Expose keyboard shortcut for closing the current tab in the tab's close button tooltip. r=jaws
This commit is contained in:
parent
788cbcdafe
commit
0e2d227441
@ -3945,16 +3945,23 @@
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
let stringWithShortcut = (stringId, keyElemId) => {
|
||||
let keyElem = document.getElementById(keyElemId);
|
||||
let shortcut = ShortcutUtils.prettifyShortcut(keyElem);
|
||||
return this.mStringBundle.getFormattedString(stringId, [shortcut]);
|
||||
};
|
||||
|
||||
var label;
|
||||
if (tab.mOverCloseButton) {
|
||||
label = this.mStringBundle.getString("tabs.closeTab.tooltip");
|
||||
label = tab.selected ?
|
||||
stringWithShortcut("tabs.closeSelectedTab.tooltip", "key_close") :
|
||||
this.mStringBundle.getString("tabs.closeTab.tooltip");
|
||||
} else if (tab._overPlayingIcon) {
|
||||
var stringID = tab.linkedBrowser.audioMuted ?
|
||||
let stringID = tab.linkedBrowser.audioMuted ?
|
||||
"tabs.unmuteAudio.tooltip" :
|
||||
"tabs.muteAudio.tooltip";
|
||||
var key = document.getElementById("key_toggleMute");
|
||||
var shortcut = ShortcutUtils.prettifyShortcut(key);
|
||||
label = this.mStringBundle.getFormattedString(stringID, [shortcut]);
|
||||
label = stringWithShortcut(stringID, "key_toggleMute");
|
||||
} else {
|
||||
label = tab.getAttribute("label") +
|
||||
(this.AppConstants.E10S_TESTING_ONLY && tab.linkedBrowser && tab.linkedBrowser.isRemoteBrowser ? " - e10s" : "");
|
||||
|
@ -31,6 +31,9 @@ tabs.closeButtonMultiple=Close tabs
|
||||
tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs
|
||||
|
||||
tabs.closeTab.tooltip=Close tab
|
||||
# LOCALIZATION NOTE (tabs.closeSelectedTab.tooltip):
|
||||
# %S is the keyboard shortcut for closing the current tab
|
||||
tabs.closeSelectedTab.tooltip=Close tab (%S)
|
||||
# LOCALIZATION NOTE (tabs.muteAudio.tooltip):
|
||||
# %S is the keyboard shortcut for "Mute tab"
|
||||
tabs.muteAudio.tooltip=Mute tab (%S)
|
||||
|
Loading…
Reference in New Issue
Block a user