diff options
author | 2019-09-23 22:29:27 +0530 | |
---|---|---|
committer | 2019-09-23 22:29:27 +0530 | |
commit | 4c4021b3633ce725ccab3bb23d1a6a7878b16514 (patch) | |
tree | 9691916b741c4ca537d24a2f278737016f00c946 /src/features/workspaces/components/WorkspaceDrawerItem.js | |
parent | Merge branch 'develop' (diff) | |
download | ferdium-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/components/WorkspaceDrawerItem.js')
-rw-r--r-- | src/features/workspaces/components/WorkspaceDrawerItem.js | 4 |
1 files changed, 4 insertions, 0 deletions
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'; | |||
5 | import injectSheet from 'react-jss'; | 5 | import injectSheet from 'react-jss'; |
6 | import classnames from 'classnames'; | 6 | import classnames from 'classnames'; |
7 | import { defineMessages, intlShape } from 'react-intl'; | 7 | import { defineMessages, intlShape } from 'react-intl'; |
8 | import { ctrlKey } from '../../../environment'; | ||
8 | 9 | ||
9 | const { Menu } = remote; | 10 | const { 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([ |