mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2026-02-27 16:11:09 +00:00
impr(ui): nav listview animation
This commit is contained in:
@ -7,6 +7,10 @@ RowLayout {
|
|||||||
id: layout
|
id: layout
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
||||||
|
SystemPalette {
|
||||||
|
id: systemPalette
|
||||||
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: navListModel
|
id: navListModel
|
||||||
|
|
||||||
@ -35,6 +39,9 @@ RowLayout {
|
|||||||
id: navListItem
|
id: navListItem
|
||||||
required property int index
|
required property int index
|
||||||
required property string label
|
required property string label
|
||||||
|
|
||||||
|
property bool isActive: navListView.currentIndex === index
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
@ -50,14 +57,29 @@ RowLayout {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
text: parent.label
|
text: parent.label
|
||||||
}
|
color: parent.isActive ? systemPalette.highlightedText : systemPalette.text
|
||||||
}
|
z: 10
|
||||||
|
|
||||||
highlight: Rectangle {
|
Behavior on color {
|
||||||
width: parent.width
|
ColorAnimation {
|
||||||
height: 30
|
duration: 150
|
||||||
color: "#FFFF88"
|
}
|
||||||
y: ListView.view.currentItem.y
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.isActive ? parent.width : 0
|
||||||
|
Behavior on width {
|
||||||
|
NumberAnimation {
|
||||||
|
easing.type: Easing.OutQuad
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
height: parent.height
|
||||||
|
color: systemPalette.highlight
|
||||||
|
z: 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user