on xenial help sign in
Much nicer "open" animation
commit7466657b86e4c6036c27b48ff1ad73e895569194 authorAlbert Astals <albert.astals@canonical.com> dateFri 11 Jul 2014, 17:26 (12 years ago) parent5664f20
2 files changed+16−11
qml/Dash/Dash.qml+12−11 qml/Dash/ScopesOverview.qml+4
qml/Dash/Dash.qml+12−11
@@ -80,6 +80,10 @@ Showable {
8080 property bool accepted: false
8181 property bool enableAnimation: false
8282 property real progress: 0
83+ Behavior on progress {
84+ enabled: overviewController.enableAnimation
85+ UbuntuNumberAnimation { }
86+ }
8387 }
8488
8589 ScopesOverview {
@@ -87,7 +91,7 @@ Showable {
8791 anchors.fill: parent
8892 scope: scopes ? scopes.getScope("scopesOverview") : null
8993 progress: overviewController.progress
90− scopeScale: dashContent.scale
94+ scopeScale: 1 - overviewController.progress * 0.6
9195 visible: scopeScale != 1
9296 onDone: hide();
9397 onFavoriteSelected: {
@@ -112,9 +116,10 @@ Showable {
112116
113117 DashContent {
114118 id: dashContent
119+ parent: overviewController.progress == 0 ? dash : scopesOverview.dashItemEater
115120 objectName: "dashContent"
116− width: parent.width
117− height: parent.height
121+ width: dash.width
122+ height: dash.height
118123 model: filteredScopes
119124 scopes: scopes
120125 visible: x != -width
@@ -131,8 +136,8 @@ Showable {
131136 dash.showScopeOnLoaded = ""
132137 }
133138 }
134− scale: dash.contentScale * (1 - overviewController.progress * 0.6)
135− clip: scale != 1.0 || scopeItem.visible
139+ scale: dash.contentScale
140+ clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
136141 Behavior on x {
137142 UbuntuNumberAnimation {
138143 onRunningChanged: {
@@ -145,13 +150,8 @@ Showable {
145150 }
146151 }
147152
148− enabled: scale == 1
153+ enabled: overviewController.progress == 0
149154 opacity: 1 - overviewController.progress
150− Behavior on scale {
151− id: dashContentScaleAnimation
152− enabled: overviewController.enableAnimation
153− UbuntuNumberAnimation { }
154− }
155155 }
156156
157157 DashBackground
@@ -188,6 +188,7 @@ Showable {
188188
189189 EdgeDragArea {
190190 id: overviewDragHandle
191+ z: 1
191192 direction: Direction.Upwards
192193 distanceThreshold: units.gu(20)
193194 enabled: !overviewController.accepted || dragging
qml/Dash/ScopesOverview.qml+4
@@ -23,6 +23,10 @@ Item {
2323
2424 property real progress: 0
2525 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
2630 property real scopeScale: 1
2731 property QtObject scopeStyle: QtObject {
2832 property string headerLogo: ""