@@ -16,6 +16,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import Ubuntu.Gestures 0.1
19import Unity 0.2
20import Unity 0.2
20import Utils 0.1
21import Utils 0.1
21import "../Components"
22import "../Components"
@@ -29,7 +30,7 @@ Showable {
29 property string showScopeOnLoaded: "clickscope"
30 property string showScopeOnLoaded: "clickscope"
30 property real contentScale: 1.0
31 property real contentScale: 1.0
32− property alias overviewHandleHeight: dashContent.overviewHandleHeight
33+ property alias overviewHandleHeight: overviewDragHandle.height
34 function setCurrentScope(scopeId, animate, reset) {
35 function setCurrentScope(scopeId, animate, reset) {
35 var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId)
36 var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId)
@@ -68,6 +69,42 @@ Showable {
68 filterRegExp: RegExp("^true$")
69 filterRegExp: RegExp("^true$")
73+ id: overviewController
75+ property bool accepted: false
76+ property bool enableAnimation: false
77+ property real progress: 0
83+ scope: scopes ? scopes.getScope("scopesOverview") : null
84+ progress: overviewController.progress
85+ scopeScale: dashContent.scale
86+ visible: scopeScale != 1
88+ onFavoriteSelected: {
89+ dashContent.setCurrentScopeAtIndex(index, false, false);
93+ overviewController.enableAnimation = true;
94+ overviewController.progress = 0;
95+ overviewController.accepted = false;
99+ target: scopesOverview.scope
101+ scopeItem.scope = scope;
102+ scopesOverview.hide();
103+ dashContent.x = -dashContent.width; // TODO
71 DashContent {
108 DashContent {
72 id: dashContent
109 id: dashContent
73 objectName: "dashContent"
110 objectName: "dashContent"
@@ -89,18 +126,35 @@ Showable {
89 dash.showScopeOnLoaded = ""
126 dash.showScopeOnLoaded = ""
92− scale: dash.contentScale
129+ scale: dash.contentScale * (1 - overviewController.progress * 0.6)
93 clip: scale != 1.0 || scopeItem.visible
130 clip: scale != 1.0 || scopeItem.visible
94 Behavior on x {
131 Behavior on x {
95 UbuntuNumberAnimation {
132 UbuntuNumberAnimation {
96 onRunningChanged: {
133 onRunningChanged: {
97 if (!running && dashContent.x == 0) {
134 if (!running && dashContent.x == 0) {
135+ // TODO If it came from ScopesOverview it has to be ScopesOverview.scope.closeScope()
98 dashContent.closeScope(scopeItem.scope);
136 dashContent.closeScope(scopeItem.scope);
99 scopeItem.scope = null;
137 scopeItem.scope = null;
144+ opacity: 1 - overviewController.progress
146+ id: dashContentScaleAnimation
147+ enabled: overviewController.enableAnimation
148+ UbuntuNumberAnimation { }
153+ anchors.fill: scopeItem
154+ source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
155+ fillMode: Image.PreserveAspectCrop
156+ horizontalAlignment: Image.AlignRight
157+ verticalAlignment: Image.AlignTop
106 GenericScopeView {
160 GenericScopeView {
@@ -114,6 +168,7 @@ Showable {
114 hasBackAction: true
168 hasBackAction: true
115 isCurrent: visible
169 isCurrent: visible
116 onBackClicked: {
170 onBackClicked: {
171+ // TODO if coming from dash overview this needs to go to overview
117 closeOverlayScope();
172 closeOverlayScope();
118 closePreview();
173 closePreview();
@@ -128,4 +183,31 @@ Showable {
188+ id: overviewDragHandle
189+ direction: Direction.Upwards
190+ distanceThreshold: units.gu(20)
191+ enabled: !overviewController.accepted || dragging
193+ anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
196+ onSceneDistanceChanged: {
197+ overviewController.enableAnimation = false;
198+ overviewController.progress = Math.min(1, sceneDistance / distanceThreshold);
202+ if (status == DirectionalDragArea.Recognized) {
203+ overviewController.accepted = true;
207+ onDraggingChanged: {
208+ overviewController.enableAnimation = true;
209+ overviewController.progress = overviewController.accepted ? 1 : 0;