From 53e8669061a146c941ec1b8aace67a2bfa3b847e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 23:34:49 -0600 Subject: [PATCH] Potential fix for some tab weirdness --- src/components/Game.vue | 5 ++--- src/components/Layer.vue | 46 +++------------------------------------- src/game/layers.tsx | 32 +++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 47 deletions(-) diff --git a/src/components/Game.vue b/src/components/Game.vue index 238a17a..7ba0d18 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -66,9 +66,8 @@ const useHeader = projInfo.useHeader; const loreBody = computeOptionalComponent(main.loreBody); function gatherLayerProps(layer: GenericLayer) { - const { display, minimized, minWidth, name, color, minimizable, nodes, minimizedDisplay } = - layer; - return { display, minimized, minWidth, name, color, minimizable, nodes, minimizedDisplay }; + const { display, minimized, name, color, minimizable, nodes, minimizedDisplay } = layer; + return { display, minimized, name, color, minimizable, nodes, minimizedDisplay }; } diff --git a/src/components/Layer.vue b/src/components/Layer.vue index a160a0b..f599543 100644 --- a/src/components/Layer.vue +++ b/src/components/Layer.vue @@ -2,7 +2,7 @@
- @@ -34,10 +34,6 @@ export default defineComponent({ type: Number, required: true }, - tab: { - type: Function as PropType<() => HTMLElement | undefined>, - required: true - }, display: { type: processedPropType(Object, String, Function), required: true @@ -47,10 +43,6 @@ export default defineComponent({ type: Object as PropType>, required: true }, - minWidth: { - type: processedPropType(Number, String), - required: true - }, name: { type: processedPropType(String), required: true @@ -63,7 +55,7 @@ export default defineComponent({ } }, setup(props) { - const { display, index, minimized, minWidth, tab, minimizedDisplay, name } = toRefs(props); + const { display, index, minimized, minimizedDisplay } = toRefs(props); const component = computeComponent(display); const minimizedComponent = computeOptionalComponent(minimizedDisplay); @@ -79,39 +71,10 @@ export default defineComponent({ minimized.value = min; } - nextTick(() => updateTab(minimized.value, unref(minWidth.value))); - watch([name, minimized, wrapRef(minWidth)], ([name, minimized, minWidth]) => { - updateTab(minimized, minWidth); - }); - function updateNodes(nodes: Record) { props.nodes.value = nodes; } - function updateTab(min: boolean, minWidth: number | string) { - minimized.value = min; - const width = - typeof minWidth === "number" || Number.isNaN(parseInt(minWidth)) - ? minWidth + "px" - : minWidth; - const tabValue = tab.value(); - if (tabValue != undefined) { - if (min) { - tabValue.style.flexGrow = "0"; - tabValue.style.flexShrink = "0"; - tabValue.style.width = "60px"; - tabValue.style.minWidth = tabValue.style.flexBasis = ""; - tabValue.style.margin = "0"; - } else { - tabValue.style.flexGrow = ""; - tabValue.style.flexShrink = ""; - tabValue.style.width = ""; - tabValue.style.minWidth = tabValue.style.flexBasis = width; - tabValue.style.margin = ""; - } - } - } - return { component, minimizedComponent, @@ -119,16 +82,13 @@ export default defineComponent({ updateNodes, unref, goBack, - setMinimized, - minimized, - minWidth + setMinimized }; } });