diff options
author | 2019-03-21 12:35:56 +0100 | |
---|---|---|
committer | 2019-03-21 12:35:56 +0100 | |
commit | 489d4cee38daf6177a9a914d3ccb5048c8acd01a (patch) | |
tree | 8f712b9f9ae8249653ad5376c9ce679413206026 /src/lib | |
parent | change workspace switch shortcuts to start with zero (diff) | |
download | ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.tar.gz ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.tar.zst ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.zip |
add workspace drawer toggle menu item and shortcut
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 1d4f0e001..2a88515f4 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -185,6 +185,14 @@ const menuItems = defineMessages({ | |||
185 | id: 'menu.workspaces.addNewWorkspace', | 185 | id: 'menu.workspaces.addNewWorkspace', |
186 | defaultMessage: '!!!Add New Workspace...', | 186 | defaultMessage: '!!!Add New Workspace...', |
187 | }, | 187 | }, |
188 | openWorkspaceDrawer: { | ||
189 | id: 'menu.workspaces.openWorkspaceDrawer', | ||
190 | defaultMessage: '!!!Open workspace drawer', | ||
191 | }, | ||
192 | closeWorkspaceDrawer: { | ||
193 | id: 'menu.workspaces.closeWorkspaceDrawer', | ||
194 | defaultMessage: '!!!Close workspace drawer', | ||
195 | }, | ||
188 | activateNextService: { | 196 | activateNextService: { |
189 | id: 'menu.services.setNextServiceActive', | 197 | id: 'menu.services.setNextServiceActive', |
190 | defaultMessage: '!!!Activate next service...', | 198 | defaultMessage: '!!!Activate next service...', |
@@ -788,6 +796,19 @@ export default class FranzMenu { | |||
788 | workspaceActions.openWorkspaceSettings(); | 796 | workspaceActions.openWorkspaceSettings(); |
789 | }, | 797 | }, |
790 | enabled: this.stores.user.isLoggedIn, | 798 | enabled: this.stores.user.isLoggedIn, |
799 | }); | ||
800 | |||
801 | // Open workspace drawer: | ||
802 | const drawerLabel = ( | ||
803 | workspacesState.isWorkspaceDrawerOpen ? menuItems.closeWorkspaceDrawer : menuItems.openWorkspaceDrawer | ||
804 | ); | ||
805 | menu.push({ | ||
806 | label: intl.formatMessage(drawerLabel), | ||
807 | accelerator: `${cmdKey}+D`, | ||
808 | click: () => { | ||
809 | workspaceActions.toggleWorkspaceDrawer(); | ||
810 | }, | ||
811 | enabled: this.stores.user.isLoggedIn, | ||
791 | }, { | 812 | }, { |
792 | type: 'separator', | 813 | type: 'separator', |
793 | }); | 814 | }); |
@@ -804,7 +825,7 @@ export default class FranzMenu { | |||
804 | }); | 825 | }); |
805 | 826 | ||
806 | // Workspace items | 827 | // Workspace items |
807 | if (this.stores.user.isLoggedIn) { | 828 | if (this.stores.user.isPremium) { |
808 | workspaces.forEach((workspace, i) => menu.push({ | 829 | workspaces.forEach((workspace, i) => menu.push({ |
809 | label: workspace.name, | 830 | label: workspace.name, |
810 | accelerator: i < 9 ? `${cmdKey}+Alt+${i + 1}` : null, | 831 | accelerator: i < 9 ? `${cmdKey}+Alt+${i + 1}` : null, |