diff --git a/src/components/system/LayerTab.vue b/src/components/system/LayerTab.vue index 41b886d..9d1ca61 100644 --- a/src/components/system/LayerTab.vue +++ b/src/components/system/LayerTab.vue @@ -100,12 +100,16 @@ export default defineComponent({ }, subtabs(): Record | null { if (layers[this.layer].subtabs) { - return Object.entries(layers[this.layer].subtabs!) + const subtabs = Object.entries(layers[this.layer].subtabs!) .filter(subtab => subtab[1].unlocked !== false) .reduce((acc: Record, curr: [string, Subtab]) => { acc[curr[0]] = curr[1]; return acc; }, {}); + if (Object.keys(subtabs).length === 1 && !themes[settings.theme].showSingleTab) { + return null; + } + return subtabs; } return null; }, diff --git a/src/components/system/Microtab.vue b/src/components/system/Microtab.vue index e418dfb..2bb1de7 100644 --- a/src/components/system/Microtab.vue +++ b/src/components/system/Microtab.vue @@ -47,7 +47,7 @@ export default defineComponent({ return layers[this.layer].microtabs![this.family]; }, microtabs() { - return Object.keys(this.tabFamily.data) + const microtabs = Object.keys(this.tabFamily.data) .filter( microtab => microtab !== "activeMicrotab" && @@ -58,6 +58,10 @@ export default defineComponent({ acc[curr] = this.tabFamily.data[curr]; return acc; }, {}); + if (Object.keys(microtabs).length === 1 && !themes[settings.theme].showSingleTab) { + return null; + } + return microtabs; }, activeMicrotab() { return this.id != undefined diff --git a/src/data/themes.ts b/src/data/themes.ts index 4bf8d55..123bbb8 100644 --- a/src/data/themes.ts +++ b/src/data/themes.ts @@ -23,7 +23,8 @@ const defaultTheme: Theme = { "--feature-margin": "0px" }, stackedInfoboxes: false, - floatingTabs: true + floatingTabs: true, + showSingleTab: false }; export enum Themes { diff --git a/src/typings/theme.d.ts b/src/typings/theme.d.ts index ee9bafd..862a3fb 100644 --- a/src/typings/theme.d.ts +++ b/src/typings/theme.d.ts @@ -21,4 +21,5 @@ export interface Theme { }; stackedInfoboxes: boolean; floatingTabs: boolean; + showSingleTab: boolean; }