Skip to content

Commit

Permalink
widget-manager: Show main menu button only when really nearby
Browse files Browse the repository at this point in the history
Don't show when nearby only in X axis, like it was.
  • Loading branch information
rafaellehmkuhl committed Nov 8, 2022
1 parent bb900e9 commit fb51e57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/views/WidgetsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import { useMouse } from '@vueuse/core'
import {
// type AsyncComponentLoader,
computed,
reactive,
// defineAsyncComponent,
ref,
watch,
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit fb51e57

Please sign in to comment.