Hide navigation bar when window is in fullscreen

This commit is contained in:
Alice Gaudon 2020-06-24 18:51:24 +02:00
parent e9bca98de8
commit 521c8d2d48
3 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,10 @@ body {
flex-direction: column;
height: 100%;
width: var(--nav-width);
body.fullscreen & {
display: none;
}
}
#navigation > :not(#service-buttons) {

View File

@ -834,4 +834,9 @@ function setContextMenu(webContents: WebContents) {
window: remote.getCurrentWindow(),
});
});
}
}
ipcRenderer.on('fullscreenchange', (e, fullscreen) => {
if (fullscreen) document.body.classList.add('fullscreen');
else document.body.classList.remove('fullscreen');
});

View File

@ -129,6 +129,13 @@ export default class MainWindow extends Window {
}
});
window.on('enter-full-screen', () => {
window.webContents.send('fullscreenchange', true);
});
window.on('leave-full-screen', () => {
window.webContents.send('fullscreenchange', false);
});
// Load navigation view
window.loadFile(path.resolve(Meta.RESOURCES_PATH, 'index.html'))
.catch(console.error);