added global menu item for fullscreen toggle

This commit is contained in:
zadam 2019-04-28 21:59:29 +02:00
parent c0496ebef3
commit f4b986e1c1
2 changed files with 16 additions and 2 deletions

View File

@ -143,7 +143,7 @@ function registerEntrypoints() {
}
if (utils.isElectron()) {
utils.bindShortcut('f11', () => {
const toggleFullscreen = function() {
const win = require('electron').remote.getCurrentWindow();
if (win.isFullScreenable()) {
@ -151,7 +151,15 @@ function registerEntrypoints() {
}
return false;
});
};
$("#toggle-fullscreen-button").click(toggleFullscreen);
utils.bindShortcut('f11', toggleFullscreen);
}
else {
// outside of electron this is handled by the browser
$("#toggle-fullscreen-button").hide();
}
// FIXME: do we really need these at this point?

View File

@ -80,6 +80,12 @@
<kbd>CTRL-R</kbd>
</a>
<a class="dropdown-item" id="toggle-fullscreen-button">
<span class="jam jam-empty"></span>
Toggle fullscreen
<kbd>F11</kbd>
</a>
<a class="dropdown-item" id="show-help-button">
<span class="jam jam-help"></span>
Show Help