property alias details: details.sourceComponent
property alias buttons: buttons.sourceComponent
+ property int textSingleLineHeight: 0
+
width: delegate.ListView.view.width
height: buttons.y + buttons.height + 5
clip: true
anchors { left: image.right; right: background.right; top: background.top; margins: 5; leftMargin: 10 }
clip: true;
elide: Text.ElideRight
+ Behavior on height {
+ id: textHeightBehavior
+ NumberAnimation { duration: 150 }
+ }
}
Loader {
}
}
+ Component.onCompleted: {
+ textSingleLineHeight = primaryText.height
+ }
+
states: [
State {
name: "expanded"
height: buttons.status == Loader.Ready ? buttons.item.childrenRect.height : 0
explicit: true
}
+ PropertyChanges {
+ target: primaryText
+ height: paintedHeight
+ }
},
State {
name: ""
when: !delegate.ListView.isCurrentItem
+ PropertyChanges {
+ target: primaryText
+ explicit: true
+ height: textSingleLineHeight
+ }
}
]
Transition {
from: ""
to: "expanded"
- NumberAnimation { properties: "height"; duration: 150 }
- PropertyAction { target: primaryText; property: "wrapMode"; value: Text.Wrap }
- PropertyAction { target: primaryText; property: "elide"; value: Text.ElideNone }
- reversible: true
+ SequentialAnimation {
+ PropertyAction { target: textHeightBehavior; property: "enabled"; value: true }
+ PropertyAction { target: primaryText; property: "wrapMode"; value: Text.Wrap }
+ PropertyAction { target: primaryText; property: "elide"; value: Text.ElideNone }
+ }
+ },
+ Transition {
+ from: "expanded"
+ to: ""
+ SequentialAnimation {
+ PropertyAction { target: textHeightBehavior; property: "enabled"; value: false }
+ NumberAnimation { target: primaryText; properties: "height"; duration: 150 }
+ PropertyAction { target: primaryText; property: "wrapMode"; value: Text.NoWrap }
+ PropertyAction { target: primaryText; property: "elide"; value: Text.ElideRight }
+ }
}
]
}