diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/layout/AppLayout.js | 21 | ||||
-rw-r--r-- | src/index.ts | 4 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 9ae72a6c1..af27e8854 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -4,6 +4,7 @@ import { observer } from 'mobx-react'; | |||
4 | import { defineMessages, injectIntl } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | import { TitleBar } from 'electron-react-titlebar/renderer'; | 5 | import { TitleBar } from 'electron-react-titlebar/renderer'; |
6 | import injectSheet from 'react-jss'; | 6 | import injectSheet from 'react-jss'; |
7 | import { ipcRenderer } from 'electron'; | ||
7 | 8 | ||
8 | import InfoBar from '../ui/InfoBar'; | 9 | import InfoBar from '../ui/InfoBar'; |
9 | import { Component as BasicAuth } from '../../features/basicAuth'; | 10 | import { Component as BasicAuth } from '../../features/basicAuth'; |
@@ -14,7 +15,7 @@ import ErrorBoundary from '../util/ErrorBoundary'; | |||
14 | 15 | ||
15 | // import globalMessages from '../../i18n/globalMessages'; | 16 | // import globalMessages from '../../i18n/globalMessages'; |
16 | 17 | ||
17 | import { isWindows } from '../../environment'; | 18 | import { isWindows, isMac } from '../../environment'; |
18 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; | 19 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; |
19 | import { workspaceStore } from '../../features/workspaces'; | 20 | import { workspaceStore } from '../../features/workspaces'; |
20 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; | 21 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; |
@@ -57,8 +58,20 @@ const styles = theme => ({ | |||
57 | : `translateX(-${theme.workspaces.drawer.width}px)`; | 58 | : `translateX(-${theme.workspaces.drawer.width}px)`; |
58 | }, | 59 | }, |
59 | }, | 60 | }, |
61 | titleBar: { | ||
62 | display: 'block', | ||
63 | zIndex: 1, | ||
64 | width: '100%', | ||
65 | height: '23px', | ||
66 | position: 'absolute', | ||
67 | top: 0, | ||
68 | }, | ||
60 | }); | 69 | }); |
61 | 70 | ||
71 | const toggleFullScreen = () => { | ||
72 | ipcRenderer.send('window.toolbar-double-clicked'); | ||
73 | }; | ||
74 | |||
62 | @injectSheet(styles) | 75 | @injectSheet(styles) |
63 | @observer | 76 | @observer |
64 | class AppLayout extends Component { | 77 | class AppLayout extends Component { |
@@ -119,6 +132,12 @@ class AppLayout extends Component { | |||
119 | icon="assets/images/logo.svg" | 132 | icon="assets/images/logo.svg" |
120 | /> | 133 | /> |
121 | )} | 134 | )} |
135 | {isMac && !isFullScreen && ( | ||
136 | <span | ||
137 | onDoubleClick={toggleFullScreen} | ||
138 | className={classes.titleBar} | ||
139 | /> | ||
140 | )} | ||
122 | <div className={`app__content ${classes.appContent}`}> | 141 | <div className={`app__content ${classes.appContent}`}> |
123 | {workspacesDrawer} | 142 | {workspacesDrawer} |
124 | {sidebar} | 143 | {sidebar} |
diff --git a/src/index.ts b/src/index.ts index b4a754289..89903a669 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -627,6 +627,10 @@ ipcMain.on('set-spellchecker-locales', (_e, { locale, serviceId }) => { | |||
627 | serviceSession.setSpellCheckerLanguages(locales); | 627 | serviceSession.setSpellCheckerLanguages(locales); |
628 | }); | 628 | }); |
629 | 629 | ||
630 | ipcMain.on('window.toolbar-double-clicked', () => { | ||
631 | mainWindow?.isMaximized() ? mainWindow.unmaximize() : mainWindow?.maximize(); | ||
632 | }); | ||
633 | |||
630 | // Quit when all windows are closed. | 634 | // Quit when all windows are closed. |
631 | app.on('window-all-closed', () => { | 635 | app.on('window-all-closed', () => { |
632 | // On OS X it is common for applications and their menu bar | 636 | // On OS X it is common for applications and their menu bar |