@@ -3,9 +3,9 @@ import { useAppSelector } from 'app/store/storeHooks';
3
3
import { ToolChooser } from 'features/controlLayers/components/Tool/ToolChooser' ;
4
4
import { CanvasManagerProviderGate } from 'features/controlLayers/contexts/CanvasManagerProviderGate' ;
5
5
import { useImageViewer } from 'features/gallery/components/ImageViewer/useImageViewer' ;
6
- import CancelCurrentQueueItemIconButton from 'features/queue/components/CancelCurrentQueueItemIconButton' ;
7
6
import { useClearQueue } from 'features/queue/components/ClearQueueConfirmationAlertDialog' ;
8
7
import { QueueButtonTooltip } from 'features/queue/components/QueueButtonTooltip' ;
8
+ import { useCancelCurrentQueueItem } from 'features/queue/hooks/useCancelCurrentQueueItem' ;
9
9
import { useInvoke } from 'features/queue/hooks/useInvoke' ;
10
10
import type { UsePanelReturn } from 'features/ui/hooks/usePanel' ;
11
11
import { selectActiveTab } from 'features/ui/store/uiSelectors' ;
@@ -17,6 +17,7 @@ import {
17
17
PiSlidersHorizontalBold ,
18
18
PiSparkleFill ,
19
19
PiTrashSimpleBold ,
20
+ PiXBold ,
20
21
} from 'react-icons/pi' ;
21
22
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue' ;
22
23
@@ -32,6 +33,7 @@ const FloatingSidePanelButtons = (props: Props) => {
32
33
const imageViewer = useImageViewer ( ) ;
33
34
const clearQueue = useClearQueue ( ) ;
34
35
const { data : queueStatus } = useGetQueueStatusQuery ( ) ;
36
+ const cancelCurrent = useCancelCurrentQueueItem ( ) ;
35
37
36
38
const queueButtonIcon = useMemo ( ( ) => {
37
39
const isProcessing = ( queueStatus ?. queue . in_progress ?? 0 ) > 0 ;
@@ -51,12 +53,13 @@ const FloatingSidePanelButtons = (props: Props) => {
51
53
< ToolChooser />
52
54
</ CanvasManagerProviderGate >
53
55
) }
54
- < ButtonGroup orientation = "vertical" >
56
+ < ButtonGroup orientation = "vertical" h = { 48 } >
55
57
< IconButton
56
58
tooltip = { t ( 'accessibility.showOptionsPanel' ) }
57
59
aria-label = { t ( 'accessibility.showOptionsPanel' ) }
58
60
onClick = { props . panelApi . toggle }
59
61
icon = { < PiSlidersHorizontalBold /> }
62
+ flexGrow = { 1 }
60
63
/>
61
64
< QueueButtonTooltip prepend = { shift } >
62
65
< IconButton
@@ -66,20 +69,31 @@ const FloatingSidePanelButtons = (props: Props) => {
66
69
isDisabled = { queue . isDisabled }
67
70
icon = { queueButtonIcon }
68
71
colorScheme = "invokeYellow"
72
+ flexGrow = { 1 }
69
73
/>
70
74
</ QueueButtonTooltip >
71
- < CancelCurrentQueueItemIconButton />
75
+ < IconButton
76
+ isDisabled = { cancelCurrent . isDisabled }
77
+ isLoading = { cancelCurrent . isLoading }
78
+ aria-label = { t ( 'queue.cancel' ) }
79
+ tooltip = { t ( 'queue.cancelTooltip' ) }
80
+ icon = { < PiXBold /> }
81
+ onClick = { cancelCurrent . cancelQueueItem }
82
+ colorScheme = "error"
83
+ flexGrow = { 1 }
84
+ />
85
+ < IconButton
86
+ isDisabled = { clearQueue . isDisabled }
87
+ isLoading = { clearQueue . isLoading }
88
+ aria-label = { t ( 'queue.clear' ) }
89
+ tooltip = { t ( 'queue.clearTooltip' ) }
90
+ icon = { < PiTrashSimpleBold /> }
91
+ colorScheme = "error"
92
+ onClick = { clearQueue . openDialog }
93
+ data-testid = { t ( 'queue.clear' ) }
94
+ flexGrow = { 1 }
95
+ />
72
96
</ ButtonGroup >
73
- < IconButton
74
- isDisabled = { clearQueue . isDisabled }
75
- isLoading = { clearQueue . isLoading }
76
- aria-label = { t ( 'queue.clear' ) }
77
- tooltip = { t ( 'queue.clearTooltip' ) }
78
- icon = { < PiTrashSimpleBold /> }
79
- colorScheme = "error"
80
- onClick = { clearQueue . openDialog }
81
- data-testid = { t ( 'queue.clear' ) }
82
- />
83
97
</ Flex >
84
98
) ;
85
99
} ;
0 commit comments