fix(stage-tamagotchi): hide on hover
This commit is contained in:
@@ -80,7 +80,9 @@ export function useTauriWindowClickThrough(live2DLookAtDefault: MaybeRefOrGetter
|
||||
live2dLookAtY.value = mousePos.value.y - windowFrame.value.origin.y
|
||||
}
|
||||
|
||||
watch(mousePos, () => updateLive2DLookAt())
|
||||
watch(mousePos, () => {
|
||||
updateLive2DLookAt()
|
||||
})
|
||||
|
||||
function updateIsCursorInside() {
|
||||
isCursorInside.value
|
||||
@@ -90,6 +92,10 @@ export function useTauriWindowClickThrough(live2DLookAtDefault: MaybeRefOrGetter
|
||||
&& mousePos.value.y <= windowFrame.value.origin.y + windowFrame.value.size.height
|
||||
}
|
||||
|
||||
watch([mousePos, windowFrame], () => {
|
||||
updateIsCursorInside()
|
||||
})
|
||||
|
||||
watch(isInitialized, async (initialized) => {
|
||||
if (initialized) {
|
||||
updateLive2DLookAt()
|
||||
|
||||
@@ -24,12 +24,10 @@ const { width, height } = useWindowSize()
|
||||
const centerPos = computed(() => ({ x: width.value / 2, y: height.value / 2 }))
|
||||
const live2dFocusAt = ref<Point>(centerPos.value)
|
||||
|
||||
const isCursorInside = ref(false)
|
||||
const shouldHideView = computed(() => isCursorInside.value && !windowStore.isControlActive && windowStore.isIgnoringMouseEvent)
|
||||
|
||||
const { listen } = useTauriEvent<AiriTamagotchiEvents>()
|
||||
const { invoke } = useTauriCore()
|
||||
const { live2dLookAtX, live2dLookAtY } = useTauriWindowClickThrough(centerPos)
|
||||
const { live2dLookAtX, live2dLookAtY, isCursorInside } = useTauriWindowClickThrough(centerPos)
|
||||
const shouldHideView = computed(() => isCursorInside.value && !windowStore.isControlActive && windowStore.isIgnoringMouseEvent)
|
||||
|
||||
const mcpStore = useMcpStore()
|
||||
const { connected, serverCmd, serverArgs } = storeToRefs(mcpStore)
|
||||
|
||||
Reference in New Issue
Block a user