mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): hide bbox button when no canvas session active
This commit is contained in:
parent
bdc428cdd8
commit
e795de5647
@ -1,4 +1,5 @@
|
|||||||
import { ButtonGroup } from '@invoke-ai/ui-library';
|
import { ButtonGroup } from '@invoke-ai/ui-library';
|
||||||
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { BboxToolButton } from 'features/controlLayers/components/BboxToolButton';
|
import { BboxToolButton } from 'features/controlLayers/components/BboxToolButton';
|
||||||
import { BrushToolButton } from 'features/controlLayers/components/BrushToolButton';
|
import { BrushToolButton } from 'features/controlLayers/components/BrushToolButton';
|
||||||
import { EraserToolButton } from 'features/controlLayers/components/EraserToolButton';
|
import { EraserToolButton } from 'features/controlLayers/components/EraserToolButton';
|
||||||
@ -11,6 +12,20 @@ import { useCanvasResetLayerHotkey } from 'features/controlLayers/hooks/useCanva
|
|||||||
export const ToolChooser: React.FC = () => {
|
export const ToolChooser: React.FC = () => {
|
||||||
useCanvasResetLayerHotkey();
|
useCanvasResetLayerHotkey();
|
||||||
useCanvasDeleteLayerHotkey();
|
useCanvasDeleteLayerHotkey();
|
||||||
|
const isCanvasSessionActive = useAppSelector((s) => s.canvasV2.session.isActive);
|
||||||
|
|
||||||
|
if (isCanvasSessionActive) {
|
||||||
|
return (
|
||||||
|
<ButtonGroup isAttached>
|
||||||
|
<BrushToolButton />
|
||||||
|
<EraserToolButton />
|
||||||
|
<RectToolButton />
|
||||||
|
<MoveToolButton />
|
||||||
|
<ViewToolButton />
|
||||||
|
<BboxToolButton />
|
||||||
|
</ButtonGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ButtonGroup isAttached>
|
<ButtonGroup isAttached>
|
||||||
@ -19,7 +34,6 @@ export const ToolChooser: React.FC = () => {
|
|||||||
<RectToolButton />
|
<RectToolButton />
|
||||||
<MoveToolButton />
|
<MoveToolButton />
|
||||||
<ViewToolButton />
|
<ViewToolButton />
|
||||||
<BboxToolButton />
|
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user