Merge lp:~schwann/gallery-app/gallery-events-design into lp:gallery-app

Proposed by Günter Schwann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 753
Merged at revision: 757
Proposed branch: lp:~schwann/gallery-app/gallery-events-design
Merge into: lp:gallery-app
Diff against target: 253 lines (+64/-80)
4 files modified
rc/qml/Components/EventCard.qml (+18/-18)
rc/qml/OrganicView/OrganicMediaList.qml (+40/-52)
rc/qml/OrganicView/OrganicView.qml (+3/-3)
tests/autopilot/gallery_app/emulators/media_selector.py (+3/-7)
To merge this branch: bzr merge lp:~schwann/gallery-app/gallery-events-design
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+171559@code.launchpad.net

Commit message

Use new design for organic view

Description of the change

Use new design for organic view

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
753. By Günter Schwann

Fix autopilot test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/Components/EventCard.qml'
2--- rc/qml/Components/EventCard.qml 2013-03-06 10:36:54 +0000
3+++ rc/qml/Components/EventCard.qml 2013-06-27 06:18:25 +0000
4@@ -45,29 +45,14 @@
5 height: units.gu(12)
6
7 Label {
8- id: eventDay
9-
10- y: units.gu(0.5)
11- width: parent.width
12-
13- font.family: "Ubuntu"
14-
15- font.pixelSize: units.dp(62)
16- color: textColor
17-
18- horizontalAlignment: Text.AlignHCenter
19-
20- text: (event) ? Qt.formatDate(event.date, "dd") : ""
21- }
22-
23- Label {
24 id: eventMonthYear
25
26- y: units.gu(8.5)
27+ y: units.gu(1.5)
28 width: parent.width
29+ height: units.gu(1)
30
31 font.family: "Ubuntu"
32- fontSize: "medium"
33+ font.pixelSize: units.dp(15)
34 color: textColor
35
36 font.capitalization: Font.AllUppercase
37@@ -75,4 +60,19 @@
38
39 text: (event) ? Qt.formatDate(event.date, "MMM yyyy") : ""
40 }
41+
42+ Label {
43+ id: eventDay
44+
45+ anchors.top: eventMonthYear.bottom
46+ width: parent.width
47+
48+ font.family: "Ubuntu"
49+ font.pixelSize: units.dp(67)
50+ color: textColor
51+
52+ horizontalAlignment: Text.AlignHCenter
53+
54+ text: (event) ? Qt.formatDate(event.date, "dd") : ""
55+ }
56 }
57
58=== modified file 'rc/qml/OrganicView/OrganicMediaList.qml'
59--- rc/qml/OrganicView/OrganicMediaList.qml 2013-06-20 11:54:49 +0000
60+++ rc/qml/OrganicView/OrganicMediaList.qml 2013-06-27 06:18:25 +0000
61@@ -25,75 +25,62 @@
62 import "../../js/Gallery.js" as Gallery
63 import "../../js/GalleryUtility.js" as GalleryUtility
64
65-// An "organic" list of photos. Used as the "tray" contents for each event in
66-// the OrganicEventView, and the layout of the OrganicAlbumView.
67+/*!
68+An "organic" list of photos. Used as the "tray" contents for each event in
69+the OrganicEventView, and the layout of the OrganicAlbumView.
70+*/
71 Item {
72 id: organicMediaList
73 objectName: "organicMediaList"
74
75- /*!
76- */
77+ ///
78 signal pressed(var mediaSource, var thumbnailRect)
79
80- /*!
81- */
82+ ///
83 property var event
84- /*!
85- */
86+ ///
87 property alias mediaModel: eventView.model
88- /*!
89- */
90+ ///
91 property SelectionState selection
92
93- /*!
94- */
95+ ///
96 property int animationDuration: Gallery.FAST_DURATION
97- /*!
98- */
99+ ///
100 property int animationEasingType: Easing.InQuint
101
102 // readonly
103- /*!
104- */
105+ ///
106 property int __mediaPerPattern: 6
107- /*!
108- */
109+ /// Size of the bigger thumbnails
110 property var __bigSize: units.gu(19)
111- /*!
112- */
113+ /// Size of the smaller thumbnails
114 property var __smallSize: units.gu(12)
115- /*!
116- */
117+ /// Space between the thumbnails
118 property real __margin: units.gu(2)
119
120- // internal
121- /*!
122- */
123- property var __photoX: [0, 0, __smallSize + __margin,
124- (__bigSize + __margin), (__bigSize + __smallSize + __margin * 2), -(__bigSize+__margin)]
125- /*!
126- */
127- property var __photoY: [0, __bigSize + __margin, __bigSize + __margin, 0, 0,
128- __smallSize + __margin]
129- /*!
130- */
131- property var __photoSize: [__bigSize, __smallSize, __smallSize, __smallSize, __smallSize,
132- __bigSize]
133- /*!
134- */
135- property var __photoWidth: [0, __smallSize + __margin, (2 * __smallSize + 2 * __margin) - (__bigSize + __margin),
136- __smallSize + __margin, __smallSize + __margin, 0]
137- /*!
138- */
139- property var __footerWidth: [0, __bigSize + __margin, __bigSize - __smallSize,
140- __bigSize - __smallSize, 0, 0]
141- /*!
142- */
143+ // internal, used to get the organix effect
144+ /// X-position shift for the delegates in one of the organic blocks
145+ property var __photoX: [-__margin, 0, 0, 0, 0, 0]
146+ /// Y-position shift for the delegates in one of the organic blocks
147+ property var __photoY: [__smallSize + __margin, 0, __bigSize + __margin,
148+ 0, __bigSize + __margin, 0]
149+ /// Size of the delegate in one of the organic blocks
150+ property var __photoSize: [__bigSize,__smallSize, __smallSize,
151+ __bigSize, __smallSize, __smallSize]
152+ /// Size to be adapted for the organic effect
153+ property var __photoWidth: [__smallSize-__margin, __bigSize - (__smallSize + __margin),
154+ 2 * __smallSize - __bigSize,__bigSize - (__smallSize + __margin),
155+ __smallSize, 0]
156+ /// Extra space on the right, for correct scroll boundary
157+ property var __footerWidth: [__smallSize, __bigSize - __smallSize,
158+ 2 * __smallSize - __bigSize + __margin,
159+ __bigSize - __smallSize, __smallSize + __margin,
160+ 0]
161+
162+ /// Used to generate a spacing between the events
163 property real __photosTopMargin: __margin / 2
164
165- height: (mediaModel.count > 1) ?
166- (__bigSize + __smallSize + __photosTopMargin + __margin + __margin/2) :
167- (__bigSize + __photosTopMargin + __margin / 2)
168+ height: __bigSize + __smallSize + __photosTopMargin + __margin + __margin/2
169
170 Behavior on height {
171 NumberAnimation {
172@@ -105,7 +92,7 @@
173 Component {
174 id: eventHeader
175 Item {
176- width: eventView.leftBuffer + __margin + __smallSize
177+ width: eventView.leftBuffer + 2*__margin //+ __smallSize
178 height: __smallSize
179 EventCard {
180 x: eventView.leftBuffer + __margin
181@@ -139,7 +126,7 @@
182
183 property bool isLoading: image.status === Image.Loading
184
185- x: patternPhoto < 5 ? __margin : -__bigSize
186+ x: __photoX[patternPhoto]
187 y: __photosTopMargin + __photoY[patternPhoto]
188 width: parent.height
189 height: parent.height
190@@ -220,8 +207,8 @@
191 id: eventView
192 // the buffers are needed, as the listview does not draw items outside is visible area
193 // but for the organic effect, x and width are "displaced" for some items (first, last)
194- property int leftBuffer: __bigSize + __margin
195- property int rightBuffer: __bigSize
196+ property int leftBuffer: __smallSize + __margin
197+ property int rightBuffer: __smallSize
198 anchors {
199 top: parent.top
200 bottom: parent.bottom
201@@ -244,6 +231,7 @@
202 orientation: Qt.Horizontal
203
204 header: eventHeader
205+ spacing: __margin
206 delegate: thumbnailDelegate
207 footer: Item {
208 width: eventView.rightBuffer +
209
210=== modified file 'rc/qml/OrganicView/OrganicView.qml'
211--- rc/qml/OrganicView/OrganicView.qml 2013-06-20 11:54:49 +0000
212+++ rc/qml/OrganicView/OrganicView.qml 2013-06-27 06:18:25 +0000
213@@ -55,7 +55,7 @@
214 property real organicMediaListPatternWidth: units.gu(49) // OrganicMediaList.patternWidth
215 /*!
216 */
217- property real organicMediaListMargin: units.gu(2) // OrganicMediaList.margin
218+ property real organicMediaListMargin: units.gu(1)
219
220 Image {
221 anchors.fill: parent
222@@ -79,11 +79,11 @@
223 // so we also get a full row on top and bottom of the whole bunch.
224 header: Item {
225 width: parent.width
226- height: organicMediaListMargin / 2
227+ height: organicMediaListMargin
228 }
229 footer: Item {
230 width: parent.width
231- height: organicMediaListMargin / 2
232+ height: organicMediaListMargin
233 }
234
235 displaced: Transition {
236
237=== modified file 'tests/autopilot/gallery_app/emulators/media_selector.py'
238--- tests/autopilot/gallery_app/emulators/media_selector.py 2013-06-18 13:22:53 +0000
239+++ tests/autopilot/gallery_app/emulators/media_selector.py 2013-06-27 06:18:25 +0000
240@@ -26,10 +26,6 @@
241 def get_second_photo(self):
242 """Returns the second photo item"""
243 selector = self.get_media_selector()
244- list_view = selector.get_children_by_type("QQuickListView")[0]
245- item = list_view.get_children_by_type("QQuickItem")[0]
246- media_list = item.get_children_by_type("OrganicMediaList")[0]
247- list_view = media_list.get_children_by_type("QQuickListView")[0]
248- item = list_view.get_children_by_type("QQuickItem")[0]
249- item = item.get_children_by_type("QQuickItem")[3]
250- return item.get_children_by_type("UbuntuShape")[0]
251+ medias = selector.select_many("OrganicItemInteraction",
252+ objectName="eventsViewPhoto")
253+ return medias[1]

Subscribers

People subscribed via source and target branches