diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-01-06 17:16:55 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-10 14:09:51 +0000 |
commit | 0a86cab635e66ba44dcf3866c698aa1d037acff9 (patch) | |
tree | 6d7b4eb478cb44376c02bdc518672e01fa1651f1 /src/imports/controls/material/TextArea.qml | |
parent | 04502964550874bef7cb35d3a6f642f8ab7c61c2 (diff) |
Editors: fix placeholder text alignment
The internal QQuickPlaceholderText creates an "implicit binding"
to the editor's horizontalAlignment, meaning that the placeholder
respects the editor's horizontal alignment when explicitly set,
and otherwise determines the alignment from the placeholder text's
visual direction.
[ChangeLog][Controls][TextField] Fixed the horizontal alignment
of the placeholder text in right-to-left UIs.
[ChangeLog][Controls][TextArea] Fixed the horizontal alignment
of the placeholder text in right-to-left UIs.
Task-number: QTBUG-55999
Change-Id: If1a8596c35c1920874996277520f1c54430c5f69
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material/TextArea.qml')
-rw-r--r-- | src/imports/controls/material/TextArea.qml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 5c4f0279..19f0cca4 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -36,6 +36,8 @@ import QtQuick 2.9 import QtQuick.Templates 2.2 as T +import QtQuick.Controls 2.2 +import QtQuick.Controls.impl 2.2 import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material.impl 2.2 @@ -58,7 +60,7 @@ T.TextArea { cursorDelegate: CursorDelegate { } - Text { + PlaceholderText { id: placeholder x: control.leftPadding y: control.topPadding @@ -67,7 +69,6 @@ T.TextArea { text: control.placeholderText font: control.font color: control.Material.hintTextColor - horizontalAlignment: control.horizontalAlignment verticalAlignment: control.verticalAlignment elide: Text.ElideRight visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) |