Skip to content

Commit

Permalink
Update view.js (#283) (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Apr 23, 2023
1 parent c4f2cea commit 671c86f
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 154 deletions.
17 changes: 13 additions & 4 deletions source/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ app.Application = class {
this._views.on('active-view-updated', () => {
this._menu.update();
});
electron.globalShortcut.register(process.platform === 'darwin' ? 'Ctrl+Cmd+F' : 'F11', () => this.execute('fullscreen'));
}

_open(path) {
Expand Down Expand Up @@ -744,9 +743,19 @@ app.View = class {
const window = this._window;
const contents = window.webContents;
switch (command) {
case 'fullscreen': window.setFullScreen(!window.isFullScreen()); break;
case 'toggle-developer-tools': contents.isDevToolsOpened() ? contents.closeDevTools() : contents.openDevTools(); break;
default: contents.send(command, data); break;
case 'toggle-developer-tools':
if (contents.isDevToolsOpened()) {
contents.closeDevTools();
} else {
contents.openDevTools();
}
break;
case 'fullscreen':
window.setFullScreen(!window.isFullScreen());
break;
default:
contents.send(command, data);
break;
}
}
}
Expand Down
Loading

0 comments on commit 671c86f

Please sign in to comment.