Transition {
from: ""
to: "expanded"
-// NumberAnimation { properties: "height"; duration: 100 }
+ NumberAnimation { properties: "height"; duration: 150 }
PropertyAction { target: primaryText; property: "wrapMode"; value: Text.Wrap }
PropertyAction { target: primaryText; property: "elide"; value: Text.ElideNone }
reversible: true
property alias image: image.source
property alias text: text.text
+ property int textSingleLineHeight: 0
+
anchors.left: parent.left
anchors.right: parent.right
width: childrenRect.width
clip: true;
elide: Text.ElideRight
state: parent.state
+ Behavior on height {
+ id: textHeightBehavior
+ NumberAnimation { duration: 150 }
+ }
}
- onHeightChanged: {}
+ Component.onCompleted: {
+ textSingleLineHeight = text.height
+ }
states: [
State {
name: "expanded"
PropertyChanges {
target: text
- wrapMode: Text.Wrap
- elide: Text.ElideNone
+ height: paintedHeight
}
+ },
+ State {
+ name: ""
+ PropertyChanges {
+ target: text
+ explicit: true
+ height: textSingleLineHeight
+ }
}
]
Transition {
from: ""
to: "expanded"
-// NumberAnimation { target: text; properties: "height"; duration: 1000 }
+ SequentialAnimation {
+ PropertyAction { target: textHeightBehavior; property: "enabled"; value: true }
+ PropertyAction { target: text; property: "wrapMode"; value: Text.Wrap }
+ PropertyAction { target: text; property: "elide"; value: Text.ElideNone }
+ }
+ },
+ Transition {
+ from: "expanded"
+ to: ""
+ SequentialAnimation {
+ PropertyAction { target: textHeightBehavior; property: "enabled"; value: false }
+ NumberAnimation { target: text; properties: "height"; duration: 150 }
+ PropertyAction { target: text; property: "wrapMode"; value: Text.NoWrap }
+ PropertyAction { target: text; property: "elide"; value: Text.ElideRight }
+ }
}
]
}