aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces
diff options
context:
space:
mode:
authorLibravatar Saurav Kothari <sauravkothari2@gmail.com>2019-09-23 22:29:27 +0530
committerLibravatar Saurav Kothari <sauravkothari2@gmail.com>2019-09-23 22:29:27 +0530
commit4c4021b3633ce725ccab3bb23d1a6a7878b16514 (patch)
tree9691916b741c4ca537d24a2f278737016f00c946 /src/features/workspaces
parentMerge branch 'develop' (diff)
downloadferdium-app-4c4021b3633ce725ccab3bb23d1a6a7878b16514.tar.gz
ferdium-app-4c4021b3633ce725ccab3bb23d1a6a7878b16514.tar.zst
ferdium-app-4c4021b3633ce725ccab3bb23d1a6a7878b16514.zip
Add tooltip with shortcuts for Workspaces
Diffstat (limited to 'src/features/workspaces')
-rw-r--r--src/features/workspaces/components/WorkspaceDrawer.js4
-rw-r--r--src/features/workspaces/components/WorkspaceDrawerItem.js4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/features/workspaces/components/WorkspaceDrawer.js b/src/features/workspaces/components/WorkspaceDrawer.js
index e7bc0b157..ee6f8416c 100644
--- a/src/features/workspaces/components/WorkspaceDrawer.js
+++ b/src/features/workspaces/components/WorkspaceDrawer.js
@@ -204,8 +204,9 @@ class WorkspaceDrawer extends Component {
204 }} 204 }}
205 services={getServicesForWorkspace(null)} 205 services={getServicesForWorkspace(null)}
206 isActive={actualWorkspace == null} 206 isActive={actualWorkspace == null}
207 shortcutIndex={0}
207 /> 208 />
208 {workspaces.map(workspace => ( 209 {workspaces.map((workspace, index) => (
209 <WorkspaceDrawerItem 210 <WorkspaceDrawerItem
210 key={workspace.id} 211 key={workspace.id}
211 name={workspace.name} 212 name={workspace.name}
@@ -218,6 +219,7 @@ class WorkspaceDrawer extends Component {
218 }} 219 }}
219 onContextMenuEditClick={() => workspaceActions.edit({ workspace })} 220 onContextMenuEditClick={() => workspaceActions.edit({ workspace })}
220 services={getServicesForWorkspace(workspace)} 221 services={getServicesForWorkspace(workspace)}
222 shortcutIndex={index + 1}
221 /> 223 />
222 ))} 224 ))}
223 <div 225 <div
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js
index 59a2144d3..9292aa87e 100644
--- a/src/features/workspaces/components/WorkspaceDrawerItem.js
+++ b/src/features/workspaces/components/WorkspaceDrawerItem.js
@@ -5,6 +5,7 @@ import { observer } from 'mobx-react';
5import injectSheet from 'react-jss'; 5import injectSheet from 'react-jss';
6import classnames from 'classnames'; 6import classnames from 'classnames';
7import { defineMessages, intlShape } from 'react-intl'; 7import { defineMessages, intlShape } from 'react-intl';
8import { ctrlKey } from '../../../environment';
8 9
9const { Menu } = remote; 10const { Menu } = remote;
10 11
@@ -69,6 +70,7 @@ class WorkspaceDrawerItem extends Component {
69 onClick: PropTypes.func.isRequired, 70 onClick: PropTypes.func.isRequired,
70 services: PropTypes.arrayOf(PropTypes.string).isRequired, 71 services: PropTypes.arrayOf(PropTypes.string).isRequired,
71 onContextMenuEditClick: PropTypes.func, 72 onContextMenuEditClick: PropTypes.func,
73 shortcutIndex: PropTypes.number.isRequired,
72 }; 74 };
73 75
74 static defaultProps = { 76 static defaultProps = {
@@ -87,6 +89,7 @@ class WorkspaceDrawerItem extends Component {
87 onClick, 89 onClick,
88 onContextMenuEditClick, 90 onContextMenuEditClick,
89 services, 91 services,
92 shortcutIndex
90 } = this.props; 93 } = this.props;
91 const { intl } = this.context; 94 const { intl } = this.context;
92 95
@@ -112,6 +115,7 @@ class WorkspaceDrawerItem extends Component {
112 onContextMenu={() => ( 115 onContextMenu={() => (
113 onContextMenuEditClick && contextMenu.popup(remote.getCurrentWindow()) 116 onContextMenuEditClick && contextMenu.popup(remote.getCurrentWindow())
114 )} 117 )}
118 data-tip={`${shortcutIndex <= 9 ? `(${ctrlKey}+Alt+${shortcutIndex})` : ''}`}
115 > 119 >
116 <span 120 <span
117 className={classnames([ 121 className={classnames([