1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add better hide animation

This commit is contained in:
kelteseth 2017-04-15 10:34:31 +02:00
parent 6bfa59f3ac
commit 78d2e608ef

View File

@ -78,10 +78,17 @@ Item {
Image {
id: imgBack
opacity: .8
width: 22
height: 30
anchors.left: parent.left
anchors.leftMargin: 0
opacity: 1
source: "qrc:/assets/icons/icon_arrow_left.svg"
sourceSize: Qt.size(16,16)
anchors.centerIn: parent
sourceSize: Qt.size(22,30)
anchors {
top:parent.top
topMargin: 0
}
}
}
@ -94,7 +101,6 @@ Item {
anchors.bottom: parent.bottom
anchors.bottomMargin: 18
onClicked: {
print()
installedListModel.setScreenToVideoFromQml( Qt.resolvedUrl(
"file:///" + installedListModel._screensPath + activeScreen
+ "/" + installedListModel.get(activeScreen).screenFile));
@ -154,6 +160,11 @@ Item {
target: sidebarWrapper
anchors.leftMargin: 0
}
PropertyChanges {
target: image
opacity: 1
anchors.topMargin: 0
}
},
State {
name: "inactive"
@ -167,6 +178,12 @@ Item {
target: sidebarWrapper
anchors.leftMargin: sidebar.width
}
PropertyChanges {
target: image
opacity: 0
anchors.topMargin: 20
}
}
]
@ -174,16 +191,43 @@ Item {
Transition {
to: "active"
NumberAnimation {
target: sidebarWrapper
properties: "anchors.leftMargin"
duration: 300
easing.type: Easing.InOutQuad
SequentialAnimation {
NumberAnimation {
target: sidebarWrapper
properties: "anchors.leftMargin"
duration: 300
easing.type: Easing.InOutQuad
}
ParallelAnimation {
NumberAnimation {
target: image
property: "opacity"
duration: 200
}
NumberAnimation {
target: image
property: "anchors.topMargin"
duration: 100
}
}
}
},
Transition {
to: "inactive"
NumberAnimation {
target: image
property: "opacity"
duration: 200
}
NumberAnimation {
target: image
property: "anchors.topMargin"
duration: 400
}
NumberAnimation {
target: sidebarWrapper
properties: "anchors.leftMargin"