mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 21:25:52 +02:00
add animation to FlexibleHeader
This commit is contained in:
@@ -66,8 +66,9 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
height: parent.height
|
height: childrenRect.height
|
||||||
width: parent.width - iconImage.width - parent.spacing
|
width: parent.width - iconImage.width - parent.spacing
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: titleItem
|
id: titleItem
|
||||||
@@ -131,7 +132,30 @@ Rectangle {
|
|||||||
font.pointSize: defaultFontSize * 1.2
|
font.pointSize: defaultFontSize * 1.2
|
||||||
width: parent.width
|
width: parent.width
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
height: text.length > 0 ? defaultFontHeight : 0
|
||||||
|
opacity: text.length > 0 ? 1 : 0
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation { duration: 200 }
|
||||||
|
}
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation { duration: 200 }
|
||||||
|
}
|
||||||
|
|
||||||
|
onTextChanged: {
|
||||||
|
if (text.length > 0) {
|
||||||
|
animationText.text = text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: animationText
|
||||||
|
color: parent.color
|
||||||
|
font: parent.font
|
||||||
|
elide: parent.elide
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user