Fix text area/field disabled text wrapping

This commit is contained in:
miruka 2020-03-17 17:41:15 -04:00
parent a64d0f037d
commit 6ede699fdf
2 changed files with 25 additions and 2 deletions

View File

@ -87,10 +87,16 @@ ScrollView {
when: disabledText !== null && ! textArea.enabled when: disabledText !== null && ! textArea.enabled
} }
Binding on implicitHeight {
value: disabledTextLabel.implicitHeight
when: disabledText !== null && ! textArea.enabled
}
Behavior on color { HColorAnimation {} } Behavior on color { HColorAnimation {} }
Behavior on placeholderTextColor { HColorAnimation {} } Behavior on placeholderTextColor { HColorAnimation {} }
HLabel { HLabel {
id: disabledTextLabel
anchors.fill: parent anchors.fill: parent
visible: opacity > 0 visible: opacity > 0
opacity: disabledText !== null && parent.enabled ? 0 : 1 opacity: disabledText !== null && parent.enabled ? 0 : 1
@ -101,7 +107,12 @@ ScrollView {
topPadding: parent.topPadding topPadding: parent.topPadding
bottomPadding: parent.bottomPadding bottomPadding: parent.bottomPadding
wrapMode: parent.wrapMode wrapMode:
parent.wrapMode === TextEdit.Wrap ? Text.Wrap :
parent.wrapMode === TextEdit.WordWrap ? Text.WordWrap :
parent.wrapMode === TextEdit.WrapAnywhere ? Text.WrapAnywhere :
Text.NoWrap
font.family: parent.font.family font.family: parent.font.family
font.pixelSize: parent.font.pixelSize font.pixelSize: parent.font.pixelSize

View File

@ -83,11 +83,18 @@ TextField {
when: disabledText !== null && ! field.enabled when: disabledText !== null && ! field.enabled
} }
Binding on implicitHeight {
value: disabledTextLabel.implicitHeight
when: disabledText !== null && ! textArea.enabled
}
Behavior on opacity { HNumberAnimation {} } Behavior on opacity { HNumberAnimation {} }
Behavior on color { HColorAnimation {} } Behavior on color { HColorAnimation {} }
Behavior on placeholderTextColor { HColorAnimation {} } Behavior on placeholderTextColor { HColorAnimation {} }
HLabel { HLabel {
id: disabledTextLabel
anchors.fill: parent anchors.fill: parent
visible: opacity > 0 visible: opacity > 0
opacity: disabledText !== null && parent.enabled ? 0 : 1 opacity: disabledText !== null && parent.enabled ? 0 : 1
@ -98,7 +105,12 @@ TextField {
topPadding: parent.topPadding topPadding: parent.topPadding
bottomPadding: parent.bottomPadding bottomPadding: parent.bottomPadding
wrapMode: parent.wrapMode wrapMode:
parent.wrapMode === TextField.Wrap ? Text.Wrap :
parent.wrapMode === TextField.WordWrap ? Text.WordWrap :
parent.wrapMode === TextField.WrapAnywhere ? Text.WrapAnywhere :
Text.NoWrap
font.family: parent.font.family font.family: parent.font.family
font.pixelSize: parent.font.pixelSize font.pixelSize: parent.font.pixelSize