import { Checkbox, Flex, FormControl, FormLabel, IconButton, Popover, PopoverBody, PopoverContent, PopoverTrigger, } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { MaskOpacity } from 'features/controlLayers/components/MaskOpacity'; import { clipToBboxChanged, invertScrollChanged } from 'features/controlLayers/store/canvasV2Slice'; import type { ChangeEvent } from 'react'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { RiSettings4Fill } from 'react-icons/ri'; const ControlLayersSettingsPopover = () => { const { t } = useTranslation(); const dispatch = useAppDispatch(); const clipToBbox = useAppSelector((s) => s.canvasV2.settings.clipToBbox); const invertScroll = useAppSelector((s) => s.canvasV2.tool.invertScroll); const onChangeInvertScroll = useCallback( (e: ChangeEvent) => dispatch(invertScrollChanged(e.target.checked)), [dispatch] ); const onChangeClipToBbox = useCallback( (e: ChangeEvent) => dispatch(clipToBboxChanged(e.target.checked)), [dispatch] ); return ( } /> {t('unifiedCanvas.invertBrushSizeScrollDirection')} {t('unifiedCanvas.clipToBbox')} ); }; export default memo(ControlLayersSettingsPopover);