pragma ComponentBehavior: Bound import QtQuick import Weave.Controls import Weave.Templates as T import "internal" T.TextArea { id: control TableLayout.leftPadding: Math.max(T.TableLayout.leftLayoutPadding, style === T.TextArea.Box ? Theme.component.input.box.paddingLeft : Theme.component.input.textarea.line.paddingLeft) TableLayout.rightPadding: Math.max(T.TableLayout.rightLayoutPadding, style === T.TextArea.Box ? Theme.component.input.box.paddingRight : Theme.component.input.textarea.line.paddingRight) TableLayout.topPadding: Math.max(T.TableLayout.topLayoutPadding, style === T.TextArea.Box ? Theme.component.input.box.paddingTop : Theme.component.input.textarea.line.paddingTop) TableLayout.bottomPadding: Math.max(T.TableLayout.bottomLayoutPadding, style === T.TextArea.Box ? Theme.component.input.box.paddingBottom : Theme.component.input.textarea.line.paddingBottom) implicitWidth: Math.max( 100, implicitBackgroundWidth + leftInset + rightInset, Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding) implicitHeight: Math.max( implicitBackgroundHeight + topInset + bottomInset, Math.max(contentHeight, placeholder.implicitHeight) + topPadding + bottomPadding) leftPadding: TableLayout.leftPadding + (decorationLoader.mirrored ? warningLoader.width : decorationLoader.width) rightPadding: TableLayout.rightPadding + (decorationLoader.mirrored ? decorationLoader.width : warningLoader.width) topPadding: TableLayout.topPadding bottomPadding: TableLayout.bottomPadding color: Theme.component.input.textColor font.family: Theme.component.label.fontFamily font.pixelSize: Theme.component.input.fontSize font.weight: Theme.component.input.fontWeight selectionColor: feedback === Feedback.LouderError ? Theme.component.input.error.backgroundColor.selected : Theme.component.input.backgroundColor.selected selectedTextColor: color placeholderTextColor: Theme.component.input.placeholder.textColor hoverEnabled: control.enabled selectByMouse: true opacity: control.enabled ? 1.0 : Theme.component.input.opacity.disabled lineHeight: Theme.component.input.lineHeight wrapMode: Text.Wrap T.DecorationItemLoader { id: decorationLoader x: mirrored ? control.width - width - control.T.TableLayout.rightPadding : control.T.TableLayout.leftPadding y: control.T.TableLayout.topPadding height: Theme.component.input.minHeight - control.T.TableLayout.topPadding - control.T.TableLayout.bottomPadding delegateItem: control sourceComponent: control.decoration leftMargin: Theme.component.menu.icon.marginLeft rightMargin: Theme.component.menu.icon.marginRight topMargin: Theme.component.menu.icon.marginTop bottomMargin: Theme.component.menu.icon.marginBottom } T.TableLayoutLoader { id: warningLoader x: mirrored ? control.leftPadding - width : control.width - control.rightPadding y: control.height - height - control.T.TableLayout.bottomPadding height: decorationLoader.height active: !indicatorsRow.visible && control.feedback !== Feedback.None && (control.feedbackDisplayType === Feedback.IconOnly || control.message.length === 0) verticalItemAlignment: TableLayout.AlignVCenter sourceComponent: InputErrorIcon { id: inputErrorIcon MouseArea { id: hoverDetector anchors.fill: parent enabled: control.feedbackToolTip.text.length > 0 hoverEnabled: true } property Component defaultContent: ToolTipContent {} ToolTip.content: control.feedbackToolTip.content ? control.feedbackToolTip.content : defaultContent ToolTip.text: control.feedbackToolTip.text ToolTip.delay: control.feedbackToolTip.delay ToolTip.timeout: control.feedbackToolTip.timeout ToolTip.preferredAlignment: control.feedbackToolTip.preferredAlignment !== Flyout.NoPreference ? control.feedbackToolTip.preferredAlignment : Flyout.PreferBottom ToolTip.visible: hoverDetector.containsMouse || (ToolTip.toolTip.parent === inputErrorIcon && ToolTip.toolTip.hovered) || (control.feedbackToolTip.visible) } } T.TableLayoutRow { id: indicatorsRow visible: indicatorsRow.children.length > 0 x: mirrored ? control.leftPadding - width : control.width - control.rightPadding y: control.height - height - control.T.TableLayout.bottomPadding height: decorationLoader.height verticalItemAlignment: TableLayout.AlignVCenter children: control.indicators } Text { id: placeholder x: control.leftPadding y: control.topPadding width: control.width - (control.leftPadding + control.rightPadding) height: decorationLoader.height text: control.placeholderText font: control.font color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight renderType: control.renderType lineHeight: control.lineHeight lineHeightMode: Text.FixedHeight } TextInputMessageLoader { id: messageLoader y: control.height width: control.width message: (control.feedback === Feedback.None && control.message !== "") || (control.feedbackDisplayType !== Feedback.IconOnly) ? control.message : "" feedback: (control.feedbackDisplayType !== Feedback.IconOnly) ? control.feedback : Feedback.None toolTip: control.feedbackToolTip } background: TextInputBackground { isTextArea: true style: control.style focused: control.activeFocus hovered: control.hovered error: control.feedback !== Feedback.None louder: control.feedback === Feedback.LouderError color: control._styleAttributes.backgroundColor } }