RibbonTabBar: Optimize animation.
This commit is contained in:
parent
6dc806fee4
commit
f9dde2c8eb
|
@ -117,9 +117,10 @@ Item{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right:parent.right
|
right:parent.right
|
||||||
}
|
}
|
||||||
|
interactive: false
|
||||||
clip: true
|
clip: true
|
||||||
property int origin_height: root.height - bar.contentHeight - top_border.height * 2
|
property int origin_height: root.height - bar.contentHeight - top_border.height * 2
|
||||||
height: origin_height
|
height: folded ? 0 :origin_height
|
||||||
currentIndex: bar.currentIndex
|
currentIndex: bar.currentIndex
|
||||||
background: Item{
|
background: Item{
|
||||||
anchors{
|
anchors{
|
||||||
|
@ -177,44 +178,14 @@ Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
Behavior on height {
|
||||||
State{
|
enabled: folded
|
||||||
name:"fold"
|
|
||||||
when: root.folded
|
|
||||||
PropertyChanges {
|
|
||||||
target: stack
|
|
||||||
height:0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State{
|
|
||||||
name:"unfold"
|
|
||||||
when: !root.folded
|
|
||||||
PropertyChanges {
|
|
||||||
target: stack
|
|
||||||
height:origin_height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "fold"
|
|
||||||
to:"unfold"
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "height"
|
|
||||||
duration: 167
|
|
||||||
easing.type: Easing.OutSine
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
from: "unfold"
|
|
||||||
to:"fold"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "height"
|
|
||||||
duration: 167
|
duration: 167
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for (let i=0,sign=0; i < stack.contentData.length; i++)
|
for (let i=0,sign=0; i < stack.contentData.length; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue