Merge lp:~fboucault/component-store/use_bottom_edge_hint into lp:component-store

Proposed by Florian Boucault
Status: Needs review
Proposed branch: lp:~fboucault/component-store/use_bottom_edge_hint
Merge into: lp:component-store
Diff against target: 178 lines (+17/-87)
1 file modified
curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml (+17/-87)
To merge this branch: bzr merge lp:~fboucault/component-store/use_bottom_edge_hint
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
Nekhelesh Ramananthan Needs Information
Review via email: mp+265587@code.launchpad.net

Commit message

PageWithBottomEdge: make use of the newly introduced BottomEdgeHint component in the Ubuntu UI Toolkit.

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

I have only one concern. Component store doesn't support versioning. So if this MP gets merged, if anybody grabs the code it will not work until they update to Ubuntu.Components 1.3 which will become stable only much later. Any idea when UC 1.3 become part of the stable phone images? Do we wait on this? Any other ideas?

Also added renato as the reviewer since he is the component author here.

review: Needs Information
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Looks good for me. And works nice with addressbook app.

review: Approve
Revision history for this message
Roman Shchekin (mrqtros) wrote :

Hmm, AFAIK 1.3 is already in store (OTA 4 bring it), so we shouldn't worry

Revision history for this message
Zsombor Egri (zsombi) wrote :

Ubuntu Components 1.3 will get stable once 15.10 is released.

Unmerged revisions

52. By Florian Boucault

PageWithBottomEdge: make use of the newly introduced BottomEdgeHint component in the Ubuntu UI Toolkit.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml'
--- curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml 2014-11-08 16:20:37 +0000
+++ curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml 2015-07-22 19:01:42 +0000
@@ -63,17 +63,17 @@
63*/63*/
6464
65import QtQuick 2.265import QtQuick 2.2
66import Ubuntu.Components 1.166import Ubuntu.Components 1.3
6767
68Page {68Page {
69 id: page69 id: page
7070
71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
72 property alias bottomEdgePageSource: edgeLoader.source72 property alias bottomEdgePageSource: edgeLoader.source
73 property alias bottomEdgeTitle: tipLabel.text73 property alias bottomEdgeTitle: bottomEdgeHint.text
74 property bool bottomEdgeEnabled: true74 property bool bottomEdgeEnabled: true
75 property int bottomEdgeExpandThreshold: page.height * 0.275 property int bottomEdgeExpandThreshold: page.height * 0.2
76 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded76 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdgeHint.height) : _areaWhenExpanded
77 property bool reloadBottomEdgePage: true77 property bool reloadBottomEdgePage: true
7878
79 readonly property alias bottomEdgePage: edgeLoader.item79 readonly property alias bottomEdgePage: edgeLoader.item
@@ -132,79 +132,12 @@
132 }132 }
133 }133 }
134134
135 Rectangle {135 BottomEdgeHint {
136 id: bgVisual136 id: bottomEdgeHint
137137 z: 1
138 color: "black"138 onClicked: bottomEdge.state = "expanded"
139 anchors.fill: page139 property bool hidden: activeFocus === false || bottomEdge.state == "expanded"
140 opacity: 0.7 * ((page.height - bottomEdge.y) / page.height)140 onHiddenChanged: hidden ? state = "Hidden" : state = "Visible"
141 z: 1
142 }
143
144 UbuntuShape {
145 id: tip
146 objectName: "bottomEdgeTip"
147
148 property bool hidden: (activeFocus === false) || ((bottomEdge.y - units.gu(1)) < tip.y)
149
150 enabled: mouseArea.enabled
151 visible: page.bottomEdgeEnabled
152 anchors {
153 bottom: parent.bottom
154 horizontalCenter: bottomEdge.horizontalCenter
155 bottomMargin: hidden ? - height + units.gu(1) : -units.gu(1)
156 Behavior on bottomMargin {
157 SequentialAnimation {
158 // wait some msecs in case of the focus change again, to avoid flickering
159 PauseAnimation {
160 duration: 300
161 }
162 UbuntuNumberAnimation {
163 duration: UbuntuAnimation.SnapDuration
164 }
165 }
166 }
167 }
168
169 z: 1
170 width: tipLabel.paintedWidth + units.gu(6)
171 height: bottomEdge.tipHeight + units.gu(1)
172 color: Theme.palette.normal.overlay
173 Label {
174 id: tipLabel
175
176 anchors {
177 top: parent.top
178 left: parent.left
179 right: parent.right
180 }
181 height: bottomEdge.tipHeight
182 verticalAlignment: Text.AlignVCenter
183 horizontalAlignment: Text.AlignHCenter
184 opacity: tip.hidden ? 0.0 : 1.0
185 Behavior on opacity {
186 UbuntuNumberAnimation {
187 duration: UbuntuAnimation.SnapDuration
188 }
189 }
190 }
191 }
192
193 Rectangle {
194 id: shadow
195
196 anchors {
197 left: parent.left
198 right: parent.right
199 bottom: parent.bottom
200 }
201 height: units.gu(1)
202 z: 1
203 opacity: 0.0
204 gradient: Gradient {
205 GradientStop { position: 0.0; color: "transparent" }
206 GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.2) }
207 }
208 }141 }
209142
210 MouseArea {143 MouseArea {
@@ -229,16 +162,18 @@
229 bottom: parent.bottom162 bottom: parent.bottom
230163
231 }164 }
232 height: bottomEdge.tipHeight165 height: bottomEdgeHint.height
233 z: 1166 z: 1
234167
235 onReleased: {168 onReleased: {
236 page.bottomEdgeReleased()169 page.bottomEdgeReleased()
237 if ((dragDirection === "BottomToTop") &&170 if ((dragDirection === "BottomToTop") &&
238 bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight)) {171 bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdgeHint.height)) {
239 bottomEdge.state = "expanded"172 bottomEdge.state = "expanded"
173 } else if (dragDirection === "BottomToTop") {
174 bottomEdge.state = "collapsed"
240 } else {175 } else {
241 bottomEdge.state = "collapsed"176 bottomEdge.state = "expanded"
242 }177 }
243 previousY = -1178 previousY = -1
244 dragDirection = "None"179 dragDirection = "None"
@@ -246,7 +181,7 @@
246181
247 onPressed: {182 onPressed: {
248 previousY = mouse.y183 previousY = mouse.y
249 tip.forceActiveFocus()184 bottomEdgeHint.forceActiveFocus()
250 }185 }
251186
252 onMouseYChanged: {187 onMouseYChanged: {
@@ -264,7 +199,6 @@
264 id: bottomEdge199 id: bottomEdge
265 objectName: "bottomEdge"200 objectName: "bottomEdge"
266201
267 readonly property int tipHeight: units.gu(3)
268 readonly property int pageStartY: 0202 readonly property int pageStartY: 0
269203
270 z: 1204 z: 1
@@ -296,10 +230,6 @@
296 State {230 State {
297 name: "floating"231 name: "floating"
298 when: mouseArea.drag.active232 when: mouseArea.drag.active
299 PropertyChanges {
300 target: shadow
301 opacity: 1.0
302 }
303 }233 }
304 ]234 ]
305235
@@ -360,7 +290,7 @@
360 edgeLoader.active = false290 edgeLoader.active = false
361 // tip will receive focus on page active true291 // tip will receive focus on page active true
362 } else {292 } else {
363 tip.forceActiveFocus()293 bottomEdgeHint.forceActiveFocus()
364 }294 }
365295
366 // notify296 // notify
@@ -396,7 +326,7 @@
396 }326 }
397327
398 onLoaded: {328 onLoaded: {
399 tip.forceActiveFocus()329 bottomEdgeHint.forceActiveFocus()
400 if (page.isReady && edgeLoader.item.active !== true) {330 if (page.isReady && edgeLoader.item.active !== true) {
401 page._pushPage()331 page._pushPage()
402 }332 }

Subscribers

People subscribed via source and target branches