mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
fix conditional bindings
note: unfortunately there is no way to understand whether the item was anchored as even not anchored item has some anchors
This commit is contained in:
parent
3ce00acd16
commit
25a44edfce
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue