on xenial help sign in
Add elastic effect to not cleseable spreads
commit6b3c4147bce597cb38239ef1c2653185c882b513 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateWed 26 Nov 2014, 17:04 (12 years ago) parentbe59376
1 file changed+8−1
qml/Stages/SpreadDelegate.qml+8−1
qml/Stages/SpreadDelegate.qml+8−1
@@ -41,10 +41,17 @@ Item {
4141 Item {
4242 objectName: "appWindowWithShadow"
4343
44− y: dragArea.distance
44+ readonly property real limit: root.height / 2
45+
46+ y: root.closeable ? dragArea.distance : elastic(dragArea.distance)
4547 width: parent.width
4648 height: parent.height
4749
50+ function elastic(distance) {
51+ var k = distance < 0 ? -limit : limit
52+ return k * (1 - Math.pow((k - 1) / k, distance))
53+ }
54+
4855 BorderImage {
4956 anchors {
5057 fill: appWindow