From 23bff8750ce897562fad7c29deacab16f07da598 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 13 Feb 2021 12:55:55 +0100 Subject: [PATCH] added static/dynamic tab size setting - fixes #3426 --- .../src/components/tabHeader.component.scss | 5 ++++ .../src/components/tabHeader.component.ts | 4 ++++ terminus-core/src/configDefaults.yaml | 1 + .../src/components/settingsTab.component.pug | 23 +++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/terminus-core/src/components/tabHeader.component.scss b/terminus-core/src/components/tabHeader.component.scss index 1c5c45e5..a1543d5f 100644 --- a/terminus-core/src/components/tabHeader.component.scss +++ b/terminus-core/src/components/tabHeader.component.scss @@ -7,6 +7,11 @@ $tabs-height: 38px; flex: 1000 1 200px; width: 200px; + &.flex-width { + flex: 1000 1 auto; + width: auto; + } + display: flex; flex-direction: row; min-width: 0; diff --git a/terminus-core/src/components/tabHeader.component.ts b/terminus-core/src/components/tabHeader.component.ts index 232d3558..9369cd42 100644 --- a/terminus-core/src/components/tabHeader.component.ts +++ b/terminus-core/src/components/tabHeader.component.ts @@ -81,6 +81,10 @@ export class TabHeaderComponent { return items.slice(1) } + @HostBinding('class.flex-width') get isFlexWidthEnabled (): boolean { + return this.config.store.appearance.flexTabs + } + @HostListener('dblclick') onDoubleClick (): void { this.showRenameTabModal() } diff --git a/terminus-core/src/configDefaults.yaml b/terminus-core/src/configDefaults.yaml index 32a5bfa4..dbffadfd 100644 --- a/terminus-core/src/configDefaults.yaml +++ b/terminus-core/src/configDefaults.yaml @@ -4,6 +4,7 @@ appearance: dockFill: 0.5 dockHideOnBlur: false dockAlwaysOnTop: true + flexTabs: false tabsLocation: top cycleTabs: true theme: Standard diff --git a/terminus-settings/src/components/settingsTab.component.pug b/terminus-settings/src/components/settingsTab.component.pug index 7b1be36c..06277d3e 100644 --- a/terminus-settings/src/components/settingsTab.component.pug +++ b/terminus-settings/src/components/settingsTab.component.pug @@ -66,6 +66,29 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab') ) | Right + .form-line + .header + .title Tabs width + .btn-group( + [(ngModel)]='config.store.appearance.flexTabs', + (ngModelChange)='config.save()', + ngbRadioGroup + ) + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='true' + ) + | Dynamic + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='false' + ) + | Fixed + .form-line .header .title(*ngIf='hostApp.platform !== Platform.macOS') Acrylic background