I cant find this anywhere
changing the maximumHeight property as a function of time so the map slides up or down
Added after 1 23 minutes:
I can get this to work ...BUT
It waits for the time to change the color and then when done just changes the height of the rectangle in a second....
I want the transition of the height change to happen along with the change of the color
Any idea when the height transition is not changing with the color change?
Rectangle {
id: footer
anchors.bottom: parent.bottom
Layout.maximumHeight: 200;
height: 20
width: parent.width
color: "red"
visible: true
state: "RELEASED"
MouseArea {
anchors.fill: parent
onPressed: footer.state = "PRESSED"
onReleased: footer.state = "RELEASED"
}
states: [
State {
name: "PRESSED"
PropertyChanges { target: footer; color: "green"; height: parent.height * .25}
PropertyChanges { target: mapView; height: parent.height * .60}
},
State {
name: "RELEASED"
PropertyChanges { target: footer; color: "purple"; Layout.height:20;}
PropertyChanges { target: mapView; height: parent.height * .80}
}
]
transitions: [
Transition {
from: "PRESSED"
to: "RELEASED"
ColorAnimation { target: footer; duration: 2000}
},
Transition {
from: "RELEASED"
to: "PRESSED"
ColorAnimation { target: footer; duration: 2000}
}
]
Rectangle {
id: footer
anchors.bottom: parent.bottom
Layout.maximumHeight: 200;
height: 20
width: parent.width
color: "red"
visible: true
state: "RELEASED"
MouseArea {
anchors.fill: parent
onPressed: footer.state = "PRESSED"
onReleased: footer.state = "RELEASED"
}
states: [
State {
name: "PRESSED"
PropertyChanges { target: footer; color: "green"; height: parent.height * .25}
PropertyChanges { target: mapView; height: parent.height * .60}
},
State {
name: "RELEASED"
PropertyChanges { target: footer; color: "purple"; Layout.height:20;}
PropertyChanges { target: mapView; height: parent.height * .80}
}
]
transitions: [
Transition {
from: "PRESSED"
to: "RELEASED"
ColorAnimation { target: footer; duration: 2000}
},
Transition {
from: "RELEASED"
to: "PRESSED"
ColorAnimation { target: footer; duration: 2000}
}
]
To copy to clipboard, switch view to plain text mode
Bookmarks