on xenial help sign in
Much nicer "open" animation
7466657Albert Astals
qml/Dash/Dash.qml+12−11
@@ -80,6 +80,10 @@ Showable {
80 property bool accepted: false
80 property bool accepted: false
81 property bool enableAnimation: false
81 property bool enableAnimation: false
82 property real progress: 0
82 property real progress: 0
83+ Behavior on progress {
84+ enabled: overviewController.enableAnimation
85+ UbuntuNumberAnimation { }
86+ }
83 }
87 }
84
88
85 ScopesOverview {
89 ScopesOverview {
@@ -87,7 +91,7 @@ Showable {
87 anchors.fill: parent
91 anchors.fill: parent
88 scope: scopes ? scopes.getScope("scopesOverview") : null
92 scope: scopes ? scopes.getScope("scopesOverview") : null
89 progress: overviewController.progress
93 progress: overviewController.progress
90− scopeScale: dashContent.scale
94+ scopeScale: 1 - overviewController.progress * 0.6
91 visible: scopeScale != 1
95 visible: scopeScale != 1
92 onDone: hide();
96 onDone: hide();
93 onFavoriteSelected: {
97 onFavoriteSelected: {
@@ -112,9 +116,10 @@ Showable {
112
116
113 DashContent {
117 DashContent {
114 id: dashContent
118 id: dashContent
119+ parent: overviewController.progress == 0 ? dash : scopesOverview.dashItemEater
115 objectName: "dashContent"
120 objectName: "dashContent"
116− width: parent.width
121+ width: dash.width
117− height: parent.height
122+ height: dash.height
118 model: filteredScopes
123 model: filteredScopes
119 scopes: scopes
124 scopes: scopes
120 visible: x != -width
125 visible: x != -width
@@ -131,8 +136,8 @@ Showable {
131 dash.showScopeOnLoaded = ""
136 dash.showScopeOnLoaded = ""
132 }
137 }
133 }
138 }
134− scale: dash.contentScale * (1 - overviewController.progress * 0.6)
139+ scale: dash.contentScale
135− clip: scale != 1.0 || scopeItem.visible
140+ clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
136 Behavior on x {
141 Behavior on x {
137 UbuntuNumberAnimation {
142 UbuntuNumberAnimation {
138 onRunningChanged: {
143 onRunningChanged: {
@@ -145,13 +150,8 @@ Showable {
145 }
150 }
146 }
151 }
147
152
148− enabled: scale == 1
153+ enabled: overviewController.progress == 0
149 opacity: 1 - overviewController.progress
154 opacity: 1 - overviewController.progress
150− Behavior on scale {
151− id: dashContentScaleAnimation
152− enabled: overviewController.enableAnimation
153− UbuntuNumberAnimation { }
154− }
155 }
155 }
156
156
157 DashBackground
157 DashBackground
@@ -188,6 +188,7 @@ Showable {
188
188
189 EdgeDragArea {
189 EdgeDragArea {
190 id: overviewDragHandle
190 id: overviewDragHandle
191+ z: 1
191 direction: Direction.Upwards
192 direction: Direction.Upwards
192 distanceThreshold: units.gu(20)
193 distanceThreshold: units.gu(20)
193 enabled: !overviewController.accepted || dragging
194 enabled: !overviewController.accepted || dragging
qml/Dash/ScopesOverview.qml+4
@@ -23,6 +23,10 @@ Item {
23
23
24 property real progress: 0
24 property real progress: 0
25 property var scope: null
25 property var scope: null
26+ // TODO This needs to account for when all is the current item
27+ // And All needs a currentItem concept
28+ // TODO we also need a centered item so when we click done from all the item grows from the middle: think
29+ property var dashItemEater: middleItems.count > 1 ? middleItems.itemAt(0).item.currentItem.item : null
26 property real scopeScale: 1
30 property real scopeScale: 1
27 property QtObject scopeStyle: QtObject {
31 property QtObject scopeStyle: QtObject {
28 property string headerLogo: ""
32 property string headerLogo: ""