Skip to content

Commit

Permalink
fix(Windows): Hide title bar when in fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Mar 28, 2018
1 parent 4d6bb5f commit 655a6ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/layout/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const messages = defineMessages({
@observer
export default class AppLayout extends Component {
static propTypes = {
isFullScreen: PropTypes.bool.isRequired,
sidebar: PropTypes.element.isRequired,
services: PropTypes.element.isRequired,
children: PropTypes.element,
Expand All @@ -69,6 +70,7 @@ export default class AppLayout extends Component {

render() {
const {
isFullScreen,
sidebar,
services,
children,
Expand All @@ -90,7 +92,7 @@ export default class AppLayout extends Component {
return (
<div>
<div className="app">
{isWindows && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
{isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
<div className="app__content">
{sidebar}
<div className="app__service">
Expand Down
1 change: 1 addition & 0 deletions src/containers/layout/AppLayoutContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default class AppLayoutContainer extends Component {

return (
<AppLayout
isFullScreen={app.isFullScreen}
isOnline={app.isOnline}
showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar}
appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED}
Expand Down
10 changes: 8 additions & 2 deletions src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '..

const { app } = remote;

const mainWindow = remote.getCurrentWindow();

const defaultLocale = DEFAULT_APP_SETTINGS.locale;
const autoLauncher = new AutoLaunch({
name: 'Franz',
Expand Down Expand Up @@ -48,6 +50,8 @@ export default class AppStore extends Store {
@observable isClearingAllCache = false;
@observable isFullScreen = mainWindow.isFullScreen();
constructor(...args) {
super(...args);
Expand Down Expand Up @@ -80,6 +84,10 @@ export default class AppStore extends Store {
window.addEventListener('online', () => { this.isOnline = true; });
window.addEventListener('offline', () => { this.isOnline = false; });
mainWindow.on('enter-full-screen', () => { this.isFullScreen = true; });
mainWindow.on('leave-full-screen', () => { this.isFullScreen = false; });
this.isOnline = navigator.onLine;
// Check if Franz should launch on start
Expand Down Expand Up @@ -170,8 +178,6 @@ export default class AppStore extends Store {
this.actions.service.setActive({ serviceId });
const mainWindow = remote.getCurrentWindow();
if (isWindows) {
mainWindow.restore();
} else if (isLinux) {
Expand Down

0 comments on commit 655a6ed

Please sign in to comment.