From 36a1a107ea80ff3aa0257017ace8a091d7d3d2e5 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Tue, 7 Nov 2023 10:57:04 -0300 Subject: [PATCH] Allow hiding bottom bar momentarily through a Cockpit Action --- src/App.vue | 12 +++++++++++- src/libs/joystick/protocols.ts | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 6a05a2f80..0011e48f0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -91,7 +91,7 @@
{ } document.addEventListener('mousemove', resetHideMouseTimeout) + +// Control bottom bar momentary hiding +const showBottomBarNow = ref(widgetStore.currentView.showBottomBarOnBoot) +watch([() => widgetStore.currentView, () => widgetStore.currentView.showBottomBarOnBoot], () => { + showBottomBarNow.value = widgetStore.currentView.showBottomBarOnBoot +}) +const debouncedToggleBottomBar = useDebounceFn(() => (showBottomBarNow.value = !showBottomBarNow.value), 25) +const bottomBarToggleCallbackId = registerActionCallback(CockpitAction.TOGGLE_BOTTOM_BAR, debouncedToggleBottomBar) +onBeforeUnmount(() => unregisterActionCallback(bottomBarToggleCallbackId))