on xenial help sign in
Add elastic effect to not cleseable spreads
6b3c414Andrea Cimitan
qml/Stages/SpreadDelegate.qml+8−1
@@ -41,10 +41,17 @@ Item {
41 Item {
41 Item {
42 objectName: "appWindowWithShadow"
42 objectName: "appWindowWithShadow"
43
43
44+ readonly property real limit: root.height / 2
45+
44− y: dragArea.distance
46+ y: root.closeable ? dragArea.distance : elastic(dragArea.distance)
45 width: parent.width
47 width: parent.width
46 height: parent.height
48 height: parent.height
47
49
50+ function elastic(distance) {
51+ var k = distance < 0 ? -limit : limit
52+ return k * (1 - Math.pow((k - 1) / k, distance))
53+ }
54+
48 BorderImage {
55 BorderImage {
49 anchors {
56 anchors {
50 fill: appWindow
57 fill: appWindow