show prev mask when hover rerun button

This commit is contained in:
Qing 2023-05-18 20:52:18 +08:00
parent a85d87a744
commit dcbba6d96d

View File

@ -19,7 +19,12 @@ import { ThemeChanger } from './ThemeChanger'
import SettingIcon from '../Settings/SettingIcon'
import PromptInput from './PromptInput'
import CoffeeIcon from '../CoffeeIcon/CoffeeIcon'
import emitter, { EVENT_CUSTOM_MASK, RERUN_LAST_MASK } from '../../event'
import emitter, {
DREAM_BUTTON_MOUSE_ENTER,
DREAM_BUTTON_MOUSE_LEAVE,
EVENT_CUSTOM_MASK,
RERUN_LAST_MASK,
} from '../../event'
import { useImage } from '../../utils'
import useHotKey from '../../hooks/useHotkey'
@ -53,6 +58,14 @@ const Header = () => {
emitter.emit(RERUN_LAST_MASK)
}, [])
const onRerunMouseEnter = () => {
emitter.emit(DREAM_BUTTON_MOUSE_ENTER)
}
const onRerunMouseLeave = () => {
emitter.emit(DREAM_BUTTON_MOUSE_LEAVE)
}
useHotKey(
'r',
() => {
@ -207,6 +220,8 @@ const Header = () => {
disabled={isInpainting}
toolTip="Rerun last mask [r]"
onClick={handleRerunLastMask}
onMouseEnter={onRerunMouseEnter}
onMouseLeave={onRerunMouseLeave}
/>
</div>
</div>