feat(ui): inpaint mask settings layout

This commit is contained in:
psychedelicious
2025-05-26 18:19:38 +10:00
parent b2a2b38ea8
commit 6fa46d35a5

View File

@@ -1,7 +1,6 @@
import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/store/storeHooks';
import { CanvasEntitySettingsWrapper } from 'features/controlLayers/components/common/CanvasEntitySettingsWrapper';
import { InpaintMaskAddButtons } from 'features/controlLayers/components/InpaintMask/InpaintMaskAddButtons';
import { InpaintMaskDenoiseLimitSlider } from 'features/controlLayers/components/InpaintMask/InpaintMaskDenoiseLimitSlider';
import { InpaintMaskNoiseSlider } from 'features/controlLayers/components/InpaintMask/InpaintMaskNoiseSlider';
import { useEntityIdentifierContext } from 'features/controlLayers/contexts/EntityIdentifierContext';
@@ -30,12 +29,15 @@ export const InpaintMaskSettings = memo(() => {
const hasNoiseLevel = useAppSelector(selectHasNoiseLevel);
if (!hasNoiseLevel && !hasDenoiseLimit) {
// If we show the <InpaintMaskAddButtons /> below, we can remove this check.
// Until then, if there are no sliders to show for the mask settings, return null. This prevents rendering an
// empty settings wrapper div, which adds unnecessary space in the UI.
return null;
}
return (
<CanvasEntitySettingsWrapper>
{!hasNoiseLevel && !hasDenoiseLimit && <InpaintMaskAddButtons />}
{/* {!hasNoiseLevel && !hasDenoiseLimit && <InpaintMaskAddButtons />} */}
{hasNoiseLevel && <InpaintMaskNoiseSlider />}
{hasDenoiseLimit && <InpaintMaskDenoiseLimitSlider />}
</CanvasEntitySettingsWrapper>