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 + } }