diff --git a/frontend/src/features/tabs/FloatingShowHideButton.scss b/frontend/src/features/tabs/FloatingShowHideButton.scss
index 4fa7060411..abb8eba9de 100644
--- a/frontend/src/features/tabs/FloatingShowHideButton.scss
+++ b/frontend/src/features/tabs/FloatingShowHideButton.scss
@@ -8,7 +8,7 @@
padding: 0;
min-width: 2rem !important;
- filter: drop-shadow(0 0 1rem var(--text-color-a3));
+ filter: var(--floating-button-drop-shadow);
&.left {
left: 0;
diff --git a/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx b/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx
index 8f306d7abf..dfe4931b82 100644
--- a/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx
+++ b/frontend/src/features/tabs/Inpainting/InpaintingCanvas.tsx
@@ -57,6 +57,7 @@ const InpaintingCanvas = () => {
isDrawing,
shouldLockBoundingBox,
shouldShowBoundingBox,
+ boundingBoxDimensions,
} = useAppSelector(inpaintingCanvasSelector);
const toast = useToast();
@@ -95,7 +96,7 @@ const InpaintingCanvas = () => {
};
image.src = imageToInpaint.url;
} else {
- setCanvasBgImage(null)
+ setCanvasBgImage(null);
}
}, [imageToInpaint, dispatch, stageScale, toast]);
@@ -243,7 +244,7 @@ const InpaintingCanvas = () => {
)}
{!shouldLockBoundingBox && (
- Transforming Bounding Box (M)
+ {`Transforming Bounding Box ${boundingBoxDimensions.width}x${boundingBoxDimensions.height} (M)`}
)}
diff --git a/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx b/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx
index 34a1f31fd0..a4c65f28e8 100644
--- a/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx
+++ b/frontend/src/features/tabs/Inpainting/components/KeyboardEventManager.tsx
@@ -6,8 +6,8 @@ import {
useAppDispatch,
useAppSelector,
} from '../../../../app/store';
+import { activeTabNameSelector } from '../../../options/optionsSelectors';
import { OptionsState } from '../../../options/optionsSlice';
-import { tabMap } from '../../InvokeTabs';
import {
InpaintingState,
setIsDrawing,
@@ -16,12 +16,16 @@ import {
} from '../inpaintingSlice';
const keyboardEventManagerSelector = createSelector(
- [(state: RootState) => state.options, (state: RootState) => state.inpainting],
- (options: OptionsState, inpainting: InpaintingState) => {
+ [
+ (state: RootState) => state.options,
+ (state: RootState) => state.inpainting,
+ activeTabNameSelector,
+ ],
+ (options: OptionsState, inpainting: InpaintingState, activeTabName) => {
const { shouldShowMask, cursorPosition, shouldLockBoundingBox } =
inpainting;
return {
- activeTabName: tabMap[options.activeTab],
+ activeTabName,
shouldShowMask,
isCursorOnCanvas: Boolean(cursorPosition),
shouldLockBoundingBox,
@@ -49,7 +53,7 @@ const KeyboardEventManager = () => {
useEffect(() => {
const listener = (e: KeyboardEvent) => {
if (
- !['z', ' '].includes(e.key) ||
+ !['x', ' '].includes(e.key) ||
activeTabName !== 'inpainting' ||
!shouldShowMask
) {
@@ -83,13 +87,13 @@ const KeyboardEventManager = () => {
}
switch (e.key) {
- case 'z': {
+ case 'x': {
dispatch(toggleTool());
break;
}
case ' ': {
if (!shouldShowMask) break;
-
+
if (e.type === 'keydown') {
dispatch(setIsDrawing(false));
}
diff --git a/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts b/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts
index 3edb3eb06f..a9b6fd14ee 100644
--- a/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts
+++ b/frontend/src/features/tabs/Inpainting/inpaintingSliceSelectors.ts
@@ -1,6 +1,7 @@
import { createSelector } from '@reduxjs/toolkit';
import _ from 'lodash';
import { RootState } from '../../../app/store';
+import { activeTabNameSelector } from '../../options/optionsSelectors';
import { OptionsState } from '../../options/optionsSlice';
import { tabMap } from '../InvokeTabs';
import { InpaintingState } from './inpaintingSlice';
@@ -18,8 +19,12 @@ export const inpaintingCanvasLinesSelector = createSelector(
);
export const inpaintingControlsSelector = createSelector(
- [(state: RootState) => state.inpainting, (state: RootState) => state.options],
- (inpainting: InpaintingState, options: OptionsState) => {
+ [
+ (state: RootState) => state.inpainting,
+ (state: RootState) => state.options,
+ activeTabNameSelector,
+ ],
+ (inpainting: InpaintingState, options: OptionsState, activeTabName) => {
const {
tool,
brushSize,
@@ -34,7 +39,7 @@ export const inpaintingControlsSelector = createSelector(
shouldShowBoundingBox,
} = inpainting;
- const { activeTab, showDualDisplay } = options;
+ const { showDualDisplay } = options;
return {
tool,
@@ -46,7 +51,7 @@ export const inpaintingControlsSelector = createSelector(
canUndo: pastLines.length > 0,
canRedo: futureLines.length > 0,
isMaskEmpty: lines.length === 0,
- activeTabName: tabMap[activeTab],
+ activeTabName,
showDualDisplay,
shouldShowBoundingBoxFill,
shouldShowBoundingBox,
@@ -75,6 +80,7 @@ export const inpaintingCanvasSelector = createSelector(
isDrawing,
shouldLockBoundingBox,
shouldShowBoundingBox,
+ boundingBoxDimensions,
} = inpainting;
return {
tool,
@@ -89,6 +95,7 @@ export const inpaintingCanvasSelector = createSelector(
isDrawing,
shouldLockBoundingBox,
shouldShowBoundingBox,
+ boundingBoxDimensions,
};
},
{
diff --git a/frontend/src/features/tabs/InvokeOptionsPanel.tsx b/frontend/src/features/tabs/InvokeOptionsPanel.tsx
index 85e55e953f..032eeeeb5a 100644
--- a/frontend/src/features/tabs/InvokeOptionsPanel.tsx
+++ b/frontend/src/features/tabs/InvokeOptionsPanel.tsx
@@ -1,9 +1,17 @@
import { createSelector } from '@reduxjs/toolkit';
-import { MouseEvent, ReactNode, useEffect, useRef } from 'react';
+import {
+ FocusEvent,
+ MouseEvent,
+ ReactNode,
+ useCallback,
+ useEffect,
+ useRef,
+} from 'react';
import { BsPinAngleFill } from 'react-icons/bs';
import { CSSTransition } from 'react-transition-group';
import { RootState, useAppDispatch, useAppSelector } from '../../app/store';
import IAIIconButton from '../../common/components/IAIIconButton';
+import useClickOutsideWatcher from '../../common/hooks/useClickOutsideWatcher';
import {
OptionsState,
setOptionsPanelScrollPosition,
@@ -50,7 +58,8 @@ const InvokeOptionsPanel = (props: Props) => {
const { children } = props;
- const handleCloseOptionsPanel = () => {
+ const handleCloseOptionsPanel = useCallback(() => {
+ if (shouldPinOptionsPanel) return;
dispatch(
setOptionsPanelScrollPosition(
optionsPanelContainerRef.current
@@ -60,8 +69,10 @@ const InvokeOptionsPanel = (props: Props) => {
);
dispatch(setShouldShowOptionsPanel(false));
dispatch(setShouldHoldOptionsPanelOpen(false));
- shouldPinOptionsPanel && dispatch(setNeedsCache(true));
- };
+ // dispatch(setNeedsCache(true));
+ }, [dispatch, shouldPinOptionsPanel]);
+
+ useClickOutsideWatcher(optionsPanelRef, handleCloseOptionsPanel);
const setCloseOptionsPanelTimer = () => {
timeoutIdRef.current = window.setTimeout(
diff --git a/frontend/src/styles/_Colors_Dark.scss b/frontend/src/styles/_Colors_Dark.scss
index 78fc683e6d..ae343f309b 100644
--- a/frontend/src/styles/_Colors_Dark.scss
+++ b/frontend/src/styles/_Colors_Dark.scss
@@ -25,8 +25,6 @@
--destructive-color: rgb(185, 55, 55);
--destructive-color-hover: rgb(255, 75, 75);
- --text-color-a3: rgba(255, 255, 255, 0.3);
-
// Error status colors
--border-color-invalid: rgb(255, 80, 50);
--box-shadow-color-invalid: rgb(210, 30, 10);
@@ -103,6 +101,6 @@
--context-menu-box-shadow: none;
--context-menu-bg-color-hover: rgb(30, 32, 42);
- // Inpainting
- --inpaint-bg-color: rgb(30, 32, 42);
+ // Shadows
+ --floating-button-drop-shadow: drop-shadow(0 0 1rem rgba(140, 101, 255, 0.5));
}
diff --git a/frontend/src/styles/_Colors_Light.scss b/frontend/src/styles/_Colors_Light.scss
index ba202bc5ef..325c0f57f5 100644
--- a/frontend/src/styles/_Colors_Light.scss
+++ b/frontend/src/styles/_Colors_Light.scss
@@ -25,8 +25,6 @@
--destructive-color: rgb(237, 51, 51);
--destructive-color-hover: rgb(255, 55, 55);
- --text-color-a3: rgba(0, 0, 0, 0.3);
-
// Error status colors
--border-color-invalid: rgb(255, 80, 50);
--box-shadow-color-invalid: none;
@@ -104,6 +102,6 @@
0px 10px 20px -15px rgba(22, 23, 24, 0.2);
--context-menu-bg-color-hover: var(--background-color-secondary);
- // Inpainting
- --inpaint-bg-color: rgb(180, 182, 184);
+ // Shadows
+ --floating-button-drop-shadow: drop-shadow(0 0 1rem rgba(0, 0, 0, 0.3));
}