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; flex-direction: column;
height: 100%; height: 100%;
width: var(--nav-width); width: var(--nav-width);
body.fullscreen & {
display: none;
}
} }
#navigation > :not(#service-buttons) { #navigation > :not(#service-buttons) {

View File

@ -835,3 +835,8 @@ function setContextMenu(webContents: WebContents) {
}); });
}); });
} }
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 // Load navigation view
window.loadFile(path.resolve(Meta.RESOURCES_PATH, 'index.html')) window.loadFile(path.resolve(Meta.RESOURCES_PATH, 'index.html'))
.catch(console.error); .catch(console.error);