Windows: still allow to bring up the menu when in full screen

This commit is contained in:
Benjamin Pasero
2015-12-18 13:25:10 +01:00
parent 71ca416768
commit e1b4ade218
3 changed files with 10 additions and 3 deletions

View File

@@ -190,6 +190,7 @@ declare class BrowserWindow extends EventEmitter {
getPosition(): number[];
setPosition(x: number, y: number): void;
setMenuBarVisibility(visible: boolean): void;
setAutoHideMenuBar(autoHide: boolean): void;
maximize(): void;
setRepresentedFilename(path: string): void;
setTitle(title: string): void;

View File

@@ -219,6 +219,7 @@ declare module 'remote' {
getPosition(): number[];
setPosition(x: number, y: number): void;
setMenuBarVisibility(visible: boolean): void;
setAutoHideMenuBar(autoHide: boolean): void;
maximize(): void;
setRepresentedFilename(path: string): void;
setDocumentEdited(edited: boolean): void;

View File

@@ -526,10 +526,15 @@ export class VSCodeWindow {
}
public toggleFullScreen(): void {
let isFullScreen = this.win.isFullScreen();
let willBeFullScreen = !this.win.isFullScreen();
this.win.setFullScreen(!isFullScreen);
this.win.setMenuBarVisibility(isFullScreen);
this.win.setFullScreen(willBeFullScreen);
// Windows: Hide the menu bar but still allow to bring it up by pressing the Alt key
if (platform.isWindows) {
this.win.setMenuBarVisibility(!willBeFullScreen);
this.win.setAutoHideMenuBar(willBeFullScreen);
}
}
public sendWhenReady(channel: string, ...args: any[]): void {