提交 c388fd9f 编写于 作者: D David Terry

add config setting to control whether alt should show the menu bar when hidden

上级 95fa5500
......@@ -656,8 +656,10 @@ export class VSCodeWindow implements IVSCodeWindow {
}
public setMenuBarVisibility(visible: boolean): void {
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
this.win.setMenuBarVisibility(visible);
this.win.setAutoHideMenuBar(!visible);
this.win.setAutoHideMenuBar(windowConfig && windowConfig.autoHideMenuBar ? !visible : false);
}
public sendWhenReady(channel: string, ...args: any[]): void {
......
......@@ -1144,13 +1144,16 @@ export class WindowsManager implements IWindowsMainService {
// Update in settings
const menuBarHidden = this.storageService.getItem(VSCodeWindow.menuBarHiddenKey, false);
const newMenuBarHidden = !menuBarHidden;
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
this.storageService.setItem(VSCodeWindow.menuBarHiddenKey, newMenuBarHidden);
// Update across windows
WindowsManager.WINDOWS.forEach(w => w.setMenuBarVisibility(!newMenuBarHidden));
// Inform user if menu bar is now hidden
if (newMenuBarHidden) {
if (newMenuBarHidden && windowConfig && windowConfig.autoHideMenuBar) {
const vscodeWindow = this.getWindowById(windowId);
if (vscodeWindow) {
vscodeWindow.send('vscode:showInfoMessage', nls.localize('hiddenMenuBar', "You can still access the menu bar by pressing the **Alt** key."));
......
......@@ -94,4 +94,5 @@ export interface IWindowSettings {
zoomLevel: number;
titleBarStyle: 'native' | 'custom';
autoDetectHighContrast: boolean;
autoHideMenuBar: boolean;
}
......@@ -200,6 +200,11 @@ let properties: { [path: string]: IJSONSchema; } = {
'type': 'boolean',
'default': false,
'description': nls.localize('showFullPath', "If enabled, will show the full path of opened files in the window title.")
},
'window.autoHideMenuBar': {
'type': 'boolean',
'default': true,
'description': nls.localize('autoHideMenuBar', "If set to false, the menu bar will no longer be shown when pressing the alt key (linux / windows only)")
}
};
......@@ -226,4 +231,4 @@ configurationRegistry.registerConfiguration({
'title': nls.localize('windowConfigurationTitle', "Window"),
'type': 'object',
'properties': properties
});
\ No newline at end of file
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册