Skip to content

Commit 655a6ed

Browse files
committed
fix(Windows): Hide title bar when in fullscreen
1 parent 4d6bb5f commit 655a6ed

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/components/layout/AppLayout.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const messages = defineMessages({
4343
@observer
4444
export default class AppLayout extends Component {
4545
static propTypes = {
46+
isFullScreen: PropTypes.bool.isRequired,
4647
sidebar: PropTypes.element.isRequired,
4748
services: PropTypes.element.isRequired,
4849
children: PropTypes.element,
@@ -69,6 +70,7 @@ export default class AppLayout extends Component {
6970

7071
render() {
7172
const {
73+
isFullScreen,
7274
sidebar,
7375
services,
7476
children,
@@ -90,7 +92,7 @@ export default class AppLayout extends Component {
9092
return (
9193
<div>
9294
<div className="app">
93-
{isWindows && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
95+
{isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
9496
<div className="app__content">
9597
{sidebar}
9698
<div className="app__service">

src/containers/layout/AppLayoutContainer.js

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default class AppLayoutContainer extends Component {
106106

107107
return (
108108
<AppLayout
109+
isFullScreen={app.isFullScreen}
109110
isOnline={app.isOnline}
110111
showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar}
111112
appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED}

src/stores/AppStore.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '..
1717

1818
const { app } = remote;
1919

20+
const mainWindow = remote.getCurrentWindow();
21+
2022
const defaultLocale = DEFAULT_APP_SETTINGS.locale;
2123
const autoLauncher = new AutoLaunch({
2224
name: 'Franz',
@@ -48,6 +50,8 @@ export default class AppStore extends Store {
4850

4951
@observable isClearingAllCache = false;
5052

53+
@observable isFullScreen = mainWindow.isFullScreen();
54+
5155
constructor(...args) {
5256
super(...args);
5357

@@ -80,6 +84,10 @@ export default class AppStore extends Store {
8084
window.addEventListener('online', () => { this.isOnline = true; });
8185
window.addEventListener('offline', () => { this.isOnline = false; });
8286

87+
mainWindow.on('enter-full-screen', () => { this.isFullScreen = true; });
88+
mainWindow.on('leave-full-screen', () => { this.isFullScreen = false; });
89+
90+
8391
this.isOnline = navigator.onLine;
8492

8593
// Check if Franz should launch on start
@@ -170,8 +178,6 @@ export default class AppStore extends Store {
170178

171179
this.actions.service.setActive({ serviceId });
172180

173-
const mainWindow = remote.getCurrentWindow();
174-
175181
if (isWindows) {
176182
mainWindow.restore();
177183
} else if (isLinux) {

0 commit comments

Comments
 (0)