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
1=== modified file 'curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml'
2--- curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml 2014-11-08 16:20:37 +0000
3+++ curated-store/ComponentStore/PageWithBottomEdge/PageWithBottomEdge.qml 2015-07-22 19:01:42 +0000
4@@ -63,17 +63,17 @@
5 */
6
7 import QtQuick 2.2
8-import Ubuntu.Components 1.1
9+import Ubuntu.Components 1.3
10
11 Page {
12 id: page
13
14 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
15 property alias bottomEdgePageSource: edgeLoader.source
16- property alias bottomEdgeTitle: tipLabel.text
17+ property alias bottomEdgeTitle: bottomEdgeHint.text
18 property bool bottomEdgeEnabled: true
19 property int bottomEdgeExpandThreshold: page.height * 0.2
20- property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
21+ property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdgeHint.height) : _areaWhenExpanded
22 property bool reloadBottomEdgePage: true
23
24 readonly property alias bottomEdgePage: edgeLoader.item
25@@ -132,79 +132,12 @@
26 }
27 }
28
29- Rectangle {
30- id: bgVisual
31-
32- color: "black"
33- anchors.fill: page
34- opacity: 0.7 * ((page.height - bottomEdge.y) / page.height)
35- z: 1
36- }
37-
38- UbuntuShape {
39- id: tip
40- objectName: "bottomEdgeTip"
41-
42- property bool hidden: (activeFocus === false) || ((bottomEdge.y - units.gu(1)) < tip.y)
43-
44- enabled: mouseArea.enabled
45- visible: page.bottomEdgeEnabled
46- anchors {
47- bottom: parent.bottom
48- horizontalCenter: bottomEdge.horizontalCenter
49- bottomMargin: hidden ? - height + units.gu(1) : -units.gu(1)
50- Behavior on bottomMargin {
51- SequentialAnimation {
52- // wait some msecs in case of the focus change again, to avoid flickering
53- PauseAnimation {
54- duration: 300
55- }
56- UbuntuNumberAnimation {
57- duration: UbuntuAnimation.SnapDuration
58- }
59- }
60- }
61- }
62-
63- z: 1
64- width: tipLabel.paintedWidth + units.gu(6)
65- height: bottomEdge.tipHeight + units.gu(1)
66- color: Theme.palette.normal.overlay
67- Label {
68- id: tipLabel
69-
70- anchors {
71- top: parent.top
72- left: parent.left
73- right: parent.right
74- }
75- height: bottomEdge.tipHeight
76- verticalAlignment: Text.AlignVCenter
77- horizontalAlignment: Text.AlignHCenter
78- opacity: tip.hidden ? 0.0 : 1.0
79- Behavior on opacity {
80- UbuntuNumberAnimation {
81- duration: UbuntuAnimation.SnapDuration
82- }
83- }
84- }
85- }
86-
87- Rectangle {
88- id: shadow
89-
90- anchors {
91- left: parent.left
92- right: parent.right
93- bottom: parent.bottom
94- }
95- height: units.gu(1)
96- z: 1
97- opacity: 0.0
98- gradient: Gradient {
99- GradientStop { position: 0.0; color: "transparent" }
100- GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.2) }
101- }
102+ BottomEdgeHint {
103+ id: bottomEdgeHint
104+ z: 1
105+ onClicked: bottomEdge.state = "expanded"
106+ property bool hidden: activeFocus === false || bottomEdge.state == "expanded"
107+ onHiddenChanged: hidden ? state = "Hidden" : state = "Visible"
108 }
109
110 MouseArea {
111@@ -229,16 +162,18 @@
112 bottom: parent.bottom
113
114 }
115- height: bottomEdge.tipHeight
116+ height: bottomEdgeHint.height
117 z: 1
118
119 onReleased: {
120 page.bottomEdgeReleased()
121 if ((dragDirection === "BottomToTop") &&
122- bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight)) {
123+ bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdgeHint.height)) {
124 bottomEdge.state = "expanded"
125+ } else if (dragDirection === "BottomToTop") {
126+ bottomEdge.state = "collapsed"
127 } else {
128- bottomEdge.state = "collapsed"
129+ bottomEdge.state = "expanded"
130 }
131 previousY = -1
132 dragDirection = "None"
133@@ -246,7 +181,7 @@
134
135 onPressed: {
136 previousY = mouse.y
137- tip.forceActiveFocus()
138+ bottomEdgeHint.forceActiveFocus()
139 }
140
141 onMouseYChanged: {
142@@ -264,7 +199,6 @@
143 id: bottomEdge
144 objectName: "bottomEdge"
145
146- readonly property int tipHeight: units.gu(3)
147 readonly property int pageStartY: 0
148
149 z: 1
150@@ -296,10 +230,6 @@
151 State {
152 name: "floating"
153 when: mouseArea.drag.active
154- PropertyChanges {
155- target: shadow
156- opacity: 1.0
157- }
158 }
159 ]
160
161@@ -360,7 +290,7 @@
162 edgeLoader.active = false
163 // tip will receive focus on page active true
164 } else {
165- tip.forceActiveFocus()
166+ bottomEdgeHint.forceActiveFocus()
167 }
168
169 // notify
170@@ -396,7 +326,7 @@
171 }
172
173 onLoaded: {
174- tip.forceActiveFocus()
175+ bottomEdgeHint.forceActiveFocus()
176 if (page.isReady && edgeLoader.item.active !== true) {
177 page._pushPage()
178 }

Subscribers

People subscribed via source and target branches