mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
add window.disableMenuBarAltBehavior option (#73258)
* add window.disableMenuBarAltBehavior option * enable alt behavior when menuBarVisibility is set to 'toggle' * rename 'window.disableMenuBarAltBehavior' to 'window.disableCustomMenuBarAltBehavior' and change its description * don't affect mnemonics
This commit is contained in:
committed by
SteVen Batten
parent
3509f35d98
commit
1151dab2bf
@@ -23,6 +23,7 @@ const $ = DOM.$;
|
||||
|
||||
export interface IMenuBarOptions {
|
||||
enableMnemonics?: boolean;
|
||||
disableAltFocus?: boolean;
|
||||
visibility?: string;
|
||||
getKeybinding?: (action: IAction) => ResolvedKeybinding | undefined;
|
||||
alwaysOnMnemonics?: boolean;
|
||||
@@ -786,7 +787,7 @@ export class MenuBar extends Disposable {
|
||||
// Clean alt key press and release
|
||||
if (allModifiersReleased && modifierKeyStatus.lastKeyPressed === 'alt' && modifierKeyStatus.lastKeyReleased === 'alt') {
|
||||
if (!this.awaitingAltRelease) {
|
||||
if (!this.isFocused) {
|
||||
if (!this.isFocused && !(this.options.disableAltFocus && this.options.visibility !== 'toggle')) {
|
||||
this.mnemonicsInUse = true;
|
||||
this.focusedMenu = { index: this.numMenusShown > 0 ? 0 : MenuBar.OVERFLOW_INDEX };
|
||||
this.focusState = MenubarState.FOCUSED;
|
||||
|
||||
Reference in New Issue
Block a user