~aacid/unity8/fix_testDash

« back to all changes in this revision

Viewing changes to qml/Stages/SpreadDelegate.qml

  • Committer: CI bot
  • Author(s): Andrea Cimitan
  • Date: 2014-12-02 09:26:30 UTC
  • mfrom: (1459.2.3 spread-dash)
  • Revision ID: ps-jenkins@lists.canonical.com-20141202092630-0f6lung4yg2rb32e
Different drag behaviour for not closable apps in spread Fixes: #1368287
Approved by: Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    Item {
42
42
        objectName: "appWindowWithShadow"
43
43
 
44
 
        y: dragArea.distance
 
44
        readonly property real limit: root.height / 4
 
45
 
 
46
        y: root.closeable ? dragArea.distance : elastic(dragArea.distance)
45
47
        width: parent.width
46
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
55
        BorderImage {
49
56
            anchors {
50
57
                fill: appWindow