mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(cockpit): render the utility strip's measured layout from the store
The Cockpit layout pass publishes the utility strip's fit to the gev-cockpit store: the HUD's --cockpit-utility-* lengths, whether only the expanded control fits, and whether a collapsed control beside an expanded one is hidden from assistive technology. CockpitView renders the lengths on the HUD and CockpitUtilityControls the strip's class and each control's aria-hidden, which now also follows a popover opened between passes. Focus leaves a control before the strip hides it. Exit publishes no layout, which also clears the expanded height, class and aria-hidden the old exit left behind. The briefing and Contact cards' positions stay imperative: the same pass measures them straight after writing them.
This commit is contained in:
1 parent
c3c69a91cd
commit
4c92f517db
12 files changed
+236
-70
No files matched your search
@@ -18,9 +18,10 @@ import CockpitUtilityControls from './panels/CockpitUtilityControls.vue';
|
||||
// The Cockpit HUD. The Cockpit controller presents the instruments, the
|
||||
// destination arrow and the vision selector on every HUD update; until it
|
||||
// does, they show the state they start in. The controller also publishes
|
||||
// which surfaces are shown; the HUD's layout stays with it, and the controls
|
||||
// keep its listeners.
|
||||
const { presence, instruments, route, vision } = storeToRefs(useCockpitStore());
|
||||
// which surfaces are shown and the utility strip's measured layout; the
|
||||
// layout pass stays with it, and the controls keep its listeners.
|
||||
const { presence, instruments, route, vision, utilityLayout } =
|
||||
storeToRefs(useCockpitStore());
|
||||
const active = computed(() => Boolean(presence.value?.active));
|
||||
const globe = useGlobeActionsStore();
|
||||
const { resetBusy } = storeToRefs(globe);
|
||||
@@ -38,6 +39,14 @@ const visionLabel = computed(() =>
|
||||
const visionTitle = computed(() =>
|
||||
t('Current style: {style} — click for next', { style: v.value.name }),
|
||||
);
|
||||
// The utility strip's measured anchor and height limits; a null value leaves
|
||||
// the stylesheet's fallback.
|
||||
const utilityStyle = computed(() => ({
|
||||
'--cockpit-utility-top': utilityLayout.value?.top ?? null,
|
||||
'--cockpit-utility-max-height': utilityLayout.value?.maxHeight ?? null,
|
||||
'--cockpit-utility-expanded-max-height':
|
||||
utilityLayout.value?.expandedMaxHeight ?? null,
|
||||
}));
|
||||
const tickStyle = (tick) =>
|
||||
tick.slot === null
|
||||
? undefined
|
||||
@@ -46,7 +55,7 @@ const tickStyle = (tick) =>
|
||||
|
||||
<template>
|
||||
<!-- Aircraft first-person view. It can be entered from the visible view switcher. -->
|
||||
<section id="cockpit-hud" aria-label="Aircraft cockpit view" :hidden="!active" v-class-toggle="{ 'signals-active': active, 'context-active': Boolean(presence?.context) }" data-i18n-aria-label :data-layer="hud.layer ?? undefined">
|
||||
<section id="cockpit-hud" aria-label="Aircraft cockpit view" :hidden="!active" :style="utilityStyle" v-class-toggle="{ 'signals-active': active, 'context-active': Boolean(presence?.context) }" data-i18n-aria-label :data-layer="hud.layer ?? undefined">
|
||||
<!-- One optical coordinate system: every targeting mark shares this center.
|
||||
Decorative only; telemetry and interactive panels remain separate. -->
|
||||
<svg class="cockpit-frame-lines" viewBox="0 0 1200 720" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
||||
|
||||
Reference in new issue
Block a user