From 25a44edfce2bd91241799e673376b880120ac8c8 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 6 Apr 2018 00:39:04 +0300 Subject: [PATCH] fix conditional bindings note: unfortunately there is no way to understand whether the item was anchored as even not anchored item has some anchors --- interface/resources/qml/controls-uit/TextField.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/controls-uit/TextField.qml b/interface/resources/qml/controls-uit/TextField.qml index 6743d08275..03b4c85a8a 100644 --- a/interface/resources/qml/controls-uit/TextField.qml +++ b/interface/resources/qml/controls-uit/TextField.qml @@ -34,6 +34,11 @@ TextField { placeholderText: textField.placeholderText + property bool rightAnchorSet: false; + anchors.onRightChanged: { + rightAnchorSet = true; + } + font.family: "Fira Sans" font.pixelSize: hifi.fontSizes.textFieldInput height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered. @@ -165,11 +170,11 @@ TextField { anchors.left: parent.left Binding on anchors.right { - when: parent.right - value: parent.right + when: rightAnchorSet + value: textField.right } Binding on wrapMode { - when: parent.right + when: rightAnchorSet value: Text.WordWrap }