From fb51e57716349ae1fa585f8e2bcb3c5db7213c12 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Mon, 7 Nov 2022 16:15:35 -0300 Subject: [PATCH] widget-manager: Show main menu button only when really nearby Don't show when nearby only in X axis, like it was. --- src/views/WidgetsView.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/WidgetsView.vue b/src/views/WidgetsView.vue index e06435116..fe2102f43 100644 --- a/src/views/WidgetsView.vue +++ b/src/views/WidgetsView.vue @@ -88,6 +88,7 @@ import { useMouse } from '@vueuse/core' import { // type AsyncComponentLoader, computed, + reactive, // defineAsyncComponent, ref, watch, @@ -110,7 +111,7 @@ import VideoPlayer from '../components/widgets/VideoPlayer.vue' const store = useWidgetManagerStore() -const { x: mouseX } = useMouse() +const mouse = reactive(useMouse()) const showMainMenuButton = ref(false) const activateMainMenuButton = ref(false) const editingMode = ref(false) @@ -121,8 +122,9 @@ const widgetsPresent = computed(() => store.currentProfile.layers.some((layer) => layer.widgets.length != 0) ) -watch(mouseX, () => { - activateMainMenuButton.value = mouseX.value < 100 || !widgetsPresent.value +watch(mouse, () => { + activateMainMenuButton.value = + (mouse.x < 100 && mouse.y < 100) || !widgetsPresent.value }) // TODO: Make this work