diff --git a/src/qml/Base/HScrollableTextArea.qml b/src/qml/Base/HScrollableTextArea.qml index 0b1d9830..aab6e8fa 100644 --- a/src/qml/Base/HScrollableTextArea.qml +++ b/src/qml/Base/HScrollableTextArea.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 2.12 ScrollView { id: scrollView + opacity: enabled ? 1 : theme.disabledElementsOpacity clip: true ScrollBar.vertical.visible: contentHeight > height @@ -27,11 +28,12 @@ ScrollView { property alias placeholderTextColor: textArea.placeholderTextColor property alias area: textArea property alias text: textArea.text - property string disabledText: "" - property string disabledTextColor: theme.controls.textArea.disabledText + property var disabledText: null property var focusItemOnTab: null + Behavior on opacity { HOpacityAnimator {} } + TextArea { id: textArea enabled: parent.enabled @@ -64,14 +66,15 @@ ScrollView { KeyNavigation.priority: KeyNavigation.BeforeItem KeyNavigation.tab: focusItemOnTab + Binding on color { value: "transparent" - when: ! textArea.enabled + when: disabledText !== null && ! textArea.enabled } Binding on placeholderTextColor { value: "transparent" - when: ! textArea.enabled + when: disabledText !== null && ! textArea.enabled } Behavior on color { HColorAnimation {} } @@ -80,9 +83,8 @@ ScrollView { HLabel { anchors.fill: parent visible: opacity > 0 - opacity: parent.enabled ? 0 : 1 - color: disabledTextColor - text: disabledText + opacity: disabledText !== null && parent.enabled ? 0 : 1 + text: disabledText || "" leftPadding: parent.leftPadding rightPadding: parent.rightPadding diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index 938acb3b..51ae63f5 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -171,13 +171,11 @@ controls: color text: colors.text color focusedText: colors.text color placeholderText: colors.dimText - color disabledText: colors.dimText textArea: color background: colors.inputBackground color text: colors.text color placeholderText: controls.textField.placeholderText - color disabledText: controls.textField.disabledText toolTip: int delay: 500