Add animations for ContentViewElement selector
This commit is contained in:
@@ -41,8 +41,9 @@ Column {
|
||||
property int childWidth: 300 * 0.68
|
||||
property int borderWidth: 7
|
||||
property int borderRadius: 7
|
||||
height: 300
|
||||
width: (300 * 0.68) + 14
|
||||
height: 300 + (borderWidth * 2)
|
||||
width: (300 * 0.68) + (borderWidth * 2)
|
||||
state: (elemSelected && (index == xIndex)) ? "selected" : "deselected"
|
||||
Image {
|
||||
height: parent.childHeight
|
||||
width: parent.childWidth
|
||||
@@ -52,14 +53,41 @@ Column {
|
||||
mipmap: true
|
||||
}
|
||||
Rectangle {
|
||||
id: rect
|
||||
color: "transparent"
|
||||
border.color: "orange"
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
border.width: parent.borderWidth
|
||||
radius: parent.borderRadius
|
||||
visible: elemSelected && (index == xIndex)
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "deselected"
|
||||
PropertyChanges {
|
||||
target: rect
|
||||
border.width: 0
|
||||
//visible: false
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "selected"
|
||||
PropertyChanges {
|
||||
target: rect
|
||||
border.width: parent.borderWidth
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
NumberAnimation {
|
||||
properties: "border.width"
|
||||
duration: 50
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
Item {width: 1; height: 15}
|
||||
Text {
|
||||
|
||||
Reference in New Issue
Block a user