Skip to content

Commit

Permalink
menubar alt key settings cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Jun 27, 2019
1 parent 1539382 commit b726573
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/vs/workbench/browser/parts/titlebar/menubarControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export abstract class MenubarControl extends Disposable {
protected keys = [
'window.menuBarVisibility',
'window.enableMenuBarMnemonics',
'window.disableCustomMenuBarAltFocus',
'window.customMenuBarAltFocus',
'window.nativeTabs'
];

Expand Down Expand Up @@ -610,9 +610,11 @@ export class CustomMenubarControl extends MenubarControl {
}

private get currentDisableMenuBarAltFocus(): boolean {
let disableMenuBarAltBehavior = this.configurationService.getValue<boolean>('window.disableCustomMenuBarAltFocus');
if (typeof disableMenuBarAltBehavior !== 'boolean') {
disableMenuBarAltBehavior = false;
let settingValue = this.configurationService.getValue<boolean>('window.customMenuBarAltFocus');

let disableMenuBarAltBehavior = false;
if (typeof settingValue === 'boolean') {
disableMenuBarAltBehavior = !settingValue;
}

return disableMenuBarAltBehavior;
Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'
'type': 'boolean',
'default': true,
'scope': ConfigurationScope.APPLICATION,
'description': nls.localize('enableMenuBarMnemonics', "If enabled, the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),
'description': nls.localize('enableMenuBarMnemonics', "Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),
'included': isWindows || isLinux
},
'window.disableCustomMenuBarAltFocus': {
'window.customMenuBarAltFocus': {
'type': 'boolean',
'default': false,
'default': true,
'scope': ConfigurationScope.APPLICATION,
'markdownDescription': nls.localize('disableCustomMenuBarAltFocus', "If enabled, disables the ability to focus the menu bar with the Alt-key when not set to toggle."),
'markdownDescription': nls.localize('customMenuBarAltFocus', "Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),
'included': isWindows || isLinux || isWeb
},
'window.openFoldersInNewWindow': {
Expand Down

0 comments on commit b726573

Please sign in to comment.