@@ -1,5 +1,6 @@
1import QtQuick 2.0
1import QtQuick 2.0
2import Ubuntu.Components 0.1
2import Ubuntu.Components 0.1
3+import Ubuntu.Gestures 0.1
3import Unity.Application 0.1
4import Unity.Application 0.1
4import "../Components"
5import "../Components"
@@ -13,6 +14,7 @@ Item {
13 // Controls to be set from outside
14 // Controls to be set from outside
14 property bool shown: false
15 property bool shown: false
15 property bool moving: false
16 property bool moving: false
17+ property int dragAreaWidth
17 // State information propagated to the outside
19 // State information propagated to the outside
18 readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible || appSplash.visible
20 readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible || appSplash.visible
@@ -175,4 +177,100 @@ Item {
175 source: src
177 source: src
176 visible: false
178 visible: false
182+ id: coverFlipDragArea
183+ direction: Direction.Rightwards
185+ //enabled: root.available
186+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
187+ width: root.dragAreaWidth
190+ print("touchX changed", touchX)
191+ coverFlip.progress = -(touchX - root.dragAreaWidth) / root.width
193+// onDraggingChanged: {
195+// coverFlip.visible = true
200+ anchors.fill: parent
207+ id: coverFlipBackground
208+ anchors.fill: parent
210+ visible: coverFlip.visible
215+ height: parent.height
217+ visible: coverFlipDragArea.dragging
219+ property real progress: 0
220+ property int maxAngle: 70
221+ onProgressChanged: print("CoverFlip progress changed", progress)
224+ model: ApplicationManager
227+ height: parent.height
228+ width: appImage.implicitWidth - (coverFlip.progress * appImage.implicitWidth)
232+ height: parent.height
233+ source: ApplicationManager.get(index).screenshot
237+ origin { x: units.gu(5); y: height / 2 }
238+ axis { x: 0; y: 1; z: 0 }
242+ if (coverFlip.progress < .5) {
243+ return coverFlip.progress * coverFlip.maxAngle
245+ return (coverFlip.progress - .5) * coverFlip.maxAngle * 2
248+ if (coverFlip.progress < .5) {
249+ return coverFlip.maxAngle - (coverFlip.progress * coverFlip.maxAngle * 2)
251+ return (coverFlip.progress - .5) * coverFlip.maxAngle * 2
254+ return Math.min(coverFlip.progress, .75) * coverFlip.maxAngle
261+ if (coverFlip.progress < .5) {
262+ return -root.width * coverFlip.progress;
263+ } else if (coverFlip.progress < .75) {
264+ // relation equation: x : width/2 = progress-.5 : 0.25
265+ return (-root.width * .5) + (root.width/2) * (coverFlip.progress - .5) / 0.25