From 0abe2f24521e9587febf4dd6590c61b72458d685 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 18 Oct 2023 11:10:15 +0300 Subject: [PATCH] UI: Disabled line height --- .../lib/settings/common/font-settings-panel.component.ts | 6 +++++- .../widget/lib/settings/common/font-settings.component.ts | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings-panel.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings-panel.component.ts index c99efa8931..562001e3c4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings-panel.component.ts @@ -69,6 +69,10 @@ export class FontSettingsPanelComponent extends PageComponent implements OnInit @coerceBoolean() autoScale = false; + @Input() + @coerceBoolean() + disabledLineHeight = false; + @Input() popover: TbPopoverComponent; @@ -106,7 +110,7 @@ export class FontSettingsPanelComponent extends PageComponent implements OnInit family: [this.font?.family, []], weight: [this.font?.weight, []], style: [this.font?.style, []], - lineHeight: [{ value: this.font?.lineHeight, disabled: this.autoScale }, []] + lineHeight: [{ value: this.font?.lineHeight, disabled: this.autoScale || this.disabledLineHeight }, []] } ); this.updatePreviewStyle(this.font); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings.component.ts index 2c3780f1fe..0fc3b20da1 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/font-settings.component.ts @@ -54,6 +54,10 @@ export class FontSettingsComponent implements OnInit, ControlValueAccessor { @coerceBoolean() autoScale = false; + @Input() + @coerceBoolean() + disabledLineHeight = false; + private modelValue: Font; private propagateChange = null; @@ -92,7 +96,8 @@ export class FontSettingsComponent implements OnInit, ControlValueAccessor { font: this.modelValue, initialPreviewStyle: this.initialPreviewStyle, clearButton: this.clearButton, - autoScale: this.autoScale + autoScale: this.autoScale, + disabledLineHeight: this.disabledLineHeight }; if (isDefinedAndNotNull(this.previewText)) { const previewText = typeof this.previewText === 'string' ? this.previewText : this.previewText();