|
@@ -62,12 +62,12 @@ const isAllGroupedSelector = (s: Data) => {
|
62
|
62
|
)
|
63
|
63
|
}
|
64
|
64
|
|
65
|
|
-const hasSelectionSelector = (s: Data) => {
|
|
65
|
+const hasSelectionClickor = (s: Data) => {
|
66
|
66
|
const { selectedIds } = s.document.pageStates[s.appState.currentPageId]
|
67
|
67
|
return selectedIds.length > 0
|
68
|
68
|
}
|
69
|
69
|
|
70
|
|
-const hasMultipleSelectionSelector = (s: Data) => {
|
|
70
|
+const hasMultipleSelectionClickor = (s: Data) => {
|
71
|
71
|
const { selectedIds } = s.document.pageStates[s.appState.currentPageId]
|
72
|
72
|
return selectedIds.length > 1
|
73
|
73
|
}
|
|
@@ -81,9 +81,9 @@ export function ActionButton(): JSX.Element {
|
81
|
81
|
|
82
|
82
|
const isAllGrouped = useSelector(isAllGroupedSelector)
|
83
|
83
|
|
84
|
|
- const hasSelection = useSelector(hasSelectionSelector)
|
|
84
|
+ const hasSelection = useSelector(hasSelectionClickor)
|
85
|
85
|
|
86
|
|
- const hasMultipleSelection = useSelector(hasMultipleSelectionSelector)
|
|
86
|
+ const hasMultipleSelection = useSelector(hasMultipleSelectionClickor)
|
87
|
87
|
|
88
|
88
|
const handleRotate = React.useCallback(() => {
|
89
|
89
|
tlstate.rotate()
|
|
@@ -180,55 +180,55 @@ export function ActionButton(): JSX.Element {
|
180
|
180
|
<DMContent>
|
181
|
181
|
<>
|
182
|
182
|
<ButtonsRow>
|
183
|
|
- <IconButton disabled={!hasSelection} onSelect={handleDuplicate}>
|
|
183
|
+ <IconButton disabled={!hasSelection} onClick={handleDuplicate}>
|
184
|
184
|
<Tooltip label="Duplicate" kbd={`#D`}>
|
185
|
185
|
<CopyIcon />
|
186
|
186
|
</Tooltip>
|
187
|
187
|
</IconButton>
|
188
|
|
- <IconButton disabled={!hasSelection} onSelect={handleRotate}>
|
|
188
|
+ <IconButton disabled={!hasSelection} onClick={handleRotate}>
|
189
|
189
|
<Tooltip label="Rotate">
|
190
|
190
|
<RotateCounterClockwiseIcon />
|
191
|
191
|
</Tooltip>
|
192
|
192
|
</IconButton>
|
193
|
|
- <IconButton disabled={!hasSelection} onSelect={handleToggleLocked}>
|
|
193
|
+ <IconButton disabled={!hasSelection} onClick={handleToggleLocked}>
|
194
|
194
|
<Tooltip label="Toogle Locked" kbd={`#L`}>
|
195
|
195
|
{isAllLocked ? <LockClosedIcon /> : <LockOpen1Icon opacity={0.4} />}
|
196
|
196
|
</Tooltip>
|
197
|
197
|
</IconButton>
|
198
|
|
- <IconButton disabled={!hasSelection} onSelect={handleToggleAspectRatio}>
|
|
198
|
+ <IconButton disabled={!hasSelection} onClick={handleToggleAspectRatio}>
|
199
|
199
|
<Tooltip label="Toogle Aspect Ratio Lock">
|
200
|
200
|
<AspectRatioIcon opacity={isAllAspectLocked ? 1 : 0.4} />
|
201
|
201
|
</Tooltip>
|
202
|
202
|
</IconButton>
|
203
|
|
- <IconButton disabled={!isAllGrouped && !hasMultipleSelection} onSelect={handleGroup}>
|
|
203
|
+ <IconButton disabled={!isAllGrouped && !hasMultipleSelection} onClick={handleGroup}>
|
204
|
204
|
<Tooltip label="Group" kbd={`#G`}>
|
205
|
205
|
<GroupIcon opacity={isAllGrouped ? 1 : 0.4} />
|
206
|
206
|
</Tooltip>
|
207
|
207
|
</IconButton>
|
208
|
208
|
</ButtonsRow>
|
209
|
209
|
<ButtonsRow>
|
210
|
|
- <IconButton disabled={!hasSelection} onSelect={handleMoveToBack}>
|
|
210
|
+ <IconButton disabled={!hasSelection} onClick={handleMoveToBack}>
|
211
|
211
|
<Tooltip label="Move to Back" kbd={`#⇧[`}>
|
212
|
212
|
<PinBottomIcon />
|
213
|
213
|
</Tooltip>
|
214
|
214
|
</IconButton>
|
215
|
215
|
|
216
|
|
- <IconButton disabled={!hasSelection} onSelect={handleMoveBackward}>
|
|
216
|
+ <IconButton disabled={!hasSelection} onClick={handleMoveBackward}>
|
217
|
217
|
<Tooltip label="Move Backward" kbd={`#[`}>
|
218
|
218
|
<ArrowDownIcon />
|
219
|
219
|
</Tooltip>
|
220
|
220
|
</IconButton>
|
221
|
|
- <IconButton disabled={!hasSelection} onSelect={handleMoveForward}>
|
|
221
|
+ <IconButton disabled={!hasSelection} onClick={handleMoveForward}>
|
222
|
222
|
<Tooltip label="Move Forward" kbd={`#]`}>
|
223
|
223
|
<ArrowUpIcon />
|
224
|
224
|
</Tooltip>
|
225
|
225
|
</IconButton>
|
226
|
|
- <IconButton disabled={!hasSelection} onSelect={handleMoveToFront}>
|
|
226
|
+ <IconButton disabled={!hasSelection} onClick={handleMoveToFront}>
|
227
|
227
|
<Tooltip label="More to Front" kbd={`#⇧]`}>
|
228
|
228
|
<PinTopIcon />
|
229
|
229
|
</Tooltip>
|
230
|
230
|
</IconButton>
|
231
|
|
- <IconButton disabled={!hasSelection} onSelect={handleDelete}>
|
|
231
|
+ <IconButton disabled={!hasSelection} onClick={handleDelete}>
|
232
|
232
|
<Tooltip label="Delete" kbd="⌫">
|
233
|
233
|
<TrashIcon />
|
234
|
234
|
</Tooltip>
|
|
@@ -236,36 +236,36 @@ export function ActionButton(): JSX.Element {
|
236
|
236
|
</ButtonsRow>
|
237
|
237
|
<Divider />
|
238
|
238
|
<ButtonsRow>
|
239
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignLeft}>
|
|
239
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignLeft}>
|
240
|
240
|
<AlignLeftIcon />
|
241
|
241
|
</IconButton>
|
242
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignCenterHorizontal}>
|
|
242
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignCenterHorizontal}>
|
243
|
243
|
<AlignCenterHorizontallyIcon />
|
244
|
244
|
</IconButton>
|
245
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignRight}>
|
|
245
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignRight}>
|
246
|
246
|
<AlignRightIcon />
|
247
|
247
|
</IconButton>
|
248
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={stretchHorizontally}>
|
|
248
|
+ <IconButton disabled={!hasTwoOrMore} onClick={stretchHorizontally}>
|
249
|
249
|
<StretchHorizontallyIcon />
|
250
|
250
|
</IconButton>
|
251
|
|
- <IconButton disabled={!hasThreeOrMore} onSelect={distributeHorizontally}>
|
|
251
|
+ <IconButton disabled={!hasThreeOrMore} onClick={distributeHorizontally}>
|
252
|
252
|
<SpaceEvenlyHorizontallyIcon />
|
253
|
253
|
</IconButton>
|
254
|
254
|
</ButtonsRow>
|
255
|
255
|
<ButtonsRow>
|
256
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignTop}>
|
|
256
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignTop}>
|
257
|
257
|
<AlignTopIcon />
|
258
|
258
|
</IconButton>
|
259
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignCenterVertical}>
|
|
259
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignCenterVertical}>
|
260
|
260
|
<AlignCenterVerticallyIcon />
|
261
|
261
|
</IconButton>
|
262
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={alignBottom}>
|
|
262
|
+ <IconButton disabled={!hasTwoOrMore} onClick={alignBottom}>
|
263
|
263
|
<AlignBottomIcon />
|
264
|
264
|
</IconButton>
|
265
|
|
- <IconButton disabled={!hasTwoOrMore} onSelect={stretchVertically}>
|
|
265
|
+ <IconButton disabled={!hasTwoOrMore} onClick={stretchVertically}>
|
266
|
266
|
<StretchVerticallyIcon />
|
267
|
267
|
</IconButton>
|
268
|
|
- <IconButton disabled={!hasThreeOrMore} onSelect={distributeVertically}>
|
|
268
|
+ <IconButton disabled={!hasThreeOrMore} onClick={distributeVertically}>
|
269
|
269
|
<SpaceEvenlyVerticallyIcon />
|
270
|
270
|
</IconButton>
|
271
|
271
|
</ButtonsRow>
|