diff options
Diffstat (limited to 'src/components/layout')
-rw-r--r-- | src/components/layout/AppLayout.js | 23 | ||||
-rw-r--r-- | src/components/layout/Sidebar.js | 37 |
2 files changed, 38 insertions, 22 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 4bacc547b..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 { |
@@ -115,10 +128,16 @@ class AppLayout extends Component { | |||
115 | <div className="app"> | 128 | <div className="app"> |
116 | {isWindows && !isFullScreen && ( | 129 | {isWindows && !isFullScreen && ( |
117 | <TitleBar | 130 | <TitleBar |
118 | menu={window.ferdi.menu.template} | 131 | menu={window['ferdi'].menu.template} |
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/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index fc33a3c58..18492be80 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -14,7 +14,6 @@ import { | |||
14 | addNewServiceShortcutKey, | 14 | addNewServiceShortcutKey, |
15 | muteFerdiShortcutKey, | 15 | muteFerdiShortcutKey, |
16 | } from '../../environment'; | 16 | } from '../../environment'; |
17 | import { workspaceStore } from '../../features/workspaces'; | ||
18 | import { todosStore } from '../../features/todos'; | 17 | import { todosStore } from '../../features/todos'; |
19 | import { todoActions } from '../../features/todos/actions'; | 18 | import { todoActions } from '../../features/todos/actions'; |
20 | import AppStore from '../../stores/AppStore'; | 19 | import AppStore from '../../stores/AppStore'; |
@@ -69,6 +68,7 @@ class Sidebar extends Component { | |||
69 | toggleAudio: PropTypes.func.isRequired, | 68 | toggleAudio: PropTypes.func.isRequired, |
70 | toggleDarkMode: PropTypes.func.isRequired, | 69 | toggleDarkMode: PropTypes.func.isRequired, |
71 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, | 70 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, |
71 | showServiceNameSetting: PropTypes.bool.isRequired, | ||
72 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 72 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
73 | deleteService: PropTypes.func.isRequired, | 73 | deleteService: PropTypes.func.isRequired, |
74 | updateService: PropTypes.func.isRequired, | 74 | updateService: PropTypes.func.isRequired, |
@@ -159,8 +159,7 @@ class Sidebar extends Component { | |||
159 | <i className="mdi mdi-lock" /> | 159 | <i className="mdi mdi-lock" /> |
160 | </button> | 160 | </button> |
161 | ) : null} | 161 | ) : null} |
162 | {todosStore.isFeatureEnabled && | 162 | {todosStore.isFeatureEnabledByUser ? ( |
163 | todosStore.isFeatureEnabledByUser ? ( | ||
164 | <button | 163 | <button |
165 | type="button" | 164 | type="button" |
166 | onClick={() => { | 165 | onClick={() => { |
@@ -178,23 +177,21 @@ class Sidebar extends Component { | |||
178 | <i className="mdi mdi-check-all" /> | 177 | <i className="mdi mdi-check-all" /> |
179 | </button> | 178 | </button> |
180 | ) : null} | 179 | ) : null} |
181 | {workspaceStore.isFeatureEnabled ? ( | 180 | <button |
182 | <button | 181 | type="button" |
183 | type="button" | 182 | onClick={() => { |
184 | onClick={() => { | 183 | toggleWorkspaceDrawer(); |
185 | toggleWorkspaceDrawer(); | 184 | this.updateToolTip(); |
186 | this.updateToolTip(); | 185 | }} |
187 | }} | 186 | className={`sidebar__button sidebar__button--workspaces ${ |
188 | className={`sidebar__button sidebar__button--workspaces ${ | 187 | isWorkspaceDrawerOpen ? 'is-active' : '' |
189 | isWorkspaceDrawerOpen ? 'is-active' : '' | 188 | }`} |
190 | }`} | 189 | data-tip={`${intl.formatMessage( |
191 | data-tip={`${intl.formatMessage( | 190 | workspaceToggleMessage, |
192 | workspaceToggleMessage, | 191 | )} (${workspaceToggleShortcutKey(false)})`} |
193 | )} (${workspaceToggleShortcutKey(false)})`} | 192 | > |
194 | > | 193 | <i className="mdi mdi-view-grid" /> |
195 | <i className="mdi mdi-view-grid" /> | 194 | </button> |
196 | </button> | ||
197 | ) : null} | ||
198 | <button | 195 | <button |
199 | type="button" | 196 | type="button" |
200 | onClick={() => { | 197 | onClick={() => { |