From 04753c61960ece9cd83fa0111fba113038a0d6b1 Mon Sep 17 00:00:00 2001 From: grml Date: Mon, 8 Jun 2026 00:53:00 +0800 Subject: [PATCH] fix: corrected handling and resolution of theme colors for tab instead of using the hardcoded items --- src/components/TabSystem/TabSystem.vue | 12 ++++++++++-- src/libs/project/BedrockProject.ts | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/TabSystem/TabSystem.vue b/src/components/TabSystem/TabSystem.vue index 7aea14d71..fdd820868 100644 --- a/src/components/TabSystem/TabSystem.vue +++ b/src/components/TabSystem/TabSystem.vue @@ -55,6 +55,13 @@ const contextMenu: Ref = ref(null) const contextMenuTab: ShallowRef = shallowRef(null) const contextMenuTabActions: Ref = ref([]) +function tabColor(tab: Tab): string { + if (!(tab instanceof FileTab)) return 'text' + if (!(ProjectManager.currentProject instanceof BedrockProject)) return 'text' + + return ProjectManager.currentProject.getPackFromPath(tab.path)?.color ?? 'text' +} + function getTabFromTarget(target: HTMLElement): HTMLElement | null { if (target.dataset.tab === 'tab') return target @@ -204,8 +211,9 @@ function dragEnd(event: DragEvent) {
- +

bestLength) { + bestPackId = packId + bestLength = packPath.length + } + } + + if (bestPackId === null) return null + + return this.packDefinitions.find((packDefinition) => packDefinition.id === bestPackId) ?? null + } }