Merge lp:~qqworini/ubuntu-rssreader-app/big-gap-grid-and-article-saved-icon into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Joey Chan
Status: Merged
Approved by: Roman Shchekin
Approved revision: 95
Merged at revision: 96
Proposed branch: lp:~qqworini/ubuntu-rssreader-app/big-gap-grid-and-article-saved-icon
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 322 lines (+125/-39)
7 files modified
OrganicGrid.qml (+32/-7)
RssFeedPage.qml (+1/-1)
article_items/ArticleFullImg.qml (+23/-8)
article_items/ArticleOneImgA.qml (+25/-10)
article_items/ArticleTextA.qml (+21/-6)
article_items/ArticleTextB.qml (+22/-7)
rssreader-app.qml (+1/-0)
To merge this branch: bzr merge lp:~qqworini/ubuntu-rssreader-app/big-gap-grid-and-article-saved-icon
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Shorts Developers Pending
Review via email: mp+189503@code.launchpad.net

Commit message

Big gap issue of gridview fixed, articles updated with Saved icon

Description of the change

Big gap issue of gridview fixed, articles updated with Saved icon

now it's hardly to see a "big gap" in gridview, if u see the big gap happen, that means today is your lucky day :P

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'OrganicGrid.qml'
2--- OrganicGrid.qml 2013-10-05 10:51:56 +0000
3+++ OrganicGrid.qml 2013-10-06 13:56:25 +0000
4@@ -19,6 +19,7 @@
5 property int lastColumnX : 0
6 property int itemY : randomMargin()
7 property var sequence : [0,1,0,1,2,1,0,0,2,1,0,1,0,0]
8+ property bool allowOneImgA: true
9
10 property int currentLoadedIndex: 0
11
12@@ -130,9 +131,16 @@
13 var imageArray = [article.image]
14 var hasImage = (article.image !== "");
15
16- // Pick the type of size we will use for this item from the sequence
17- var sizeType = sequence[i % sequence.length];
18- var alignType = Math.round(Math.random())
19+
20+ // var sizeType = sequence[i % sequence.length];
21+ // prevent two ImgOneA appear together
22+ var alignType
23+ do {
24+ alignType = Math.round(Math.random())
25+ if (allowOneImgA)
26+ break
27+ }
28+ while (alignType == 0 && hasImage)
29
30 var alignIndex
31
32@@ -145,12 +153,13 @@
33 alignIndex = 1
34 break;
35 }
36- sizeType = 0;
37+// sizeType = 0;
38 }
39 else {
40 switch(alignType) {
41 case 0:
42 alignIndex = 2
43+// allowOneImgA = false
44 break;
45 case 1:
46 alignIndex = 3
47@@ -173,6 +182,11 @@
48 if(itemY + articleItem.height > organicGridRoot.height) {
49 itemY = randomMargin();
50 xEdge = lastColumnX;
51+ if (alignIndex == 2)
52+ allowOneImgA = false
53+ }
54+ else /*if (alignIndex == 2)*/ {
55+ allowOneImgA = true
56 }
57
58 // The xEdge is where the last "column" of items were placed last
59@@ -233,8 +247,14 @@
60 var hasImage = (article.image !== "");
61
62 // Pick the type of size we will use for this item from the sequence
63- var sizeType = sequence[i % sequence.length];
64- var alignType = Math.round(Math.random())
65+ // prevent two ImgOneA appear together
66+ var alignType
67+ do {
68+ alignType = Math.round(Math.random())
69+ if (allowOneImgA)
70+ break
71+ }
72+ while (alignType == 0 && hasImage)
73
74 //var alignName
75 var alignIndex
76@@ -251,7 +271,7 @@
77 break;
78 }
79 //noImageName += "NoImage";
80- sizeType = 0;
81+// sizeType = 0;
82 }
83 else {
84 switch(alignType) {
85@@ -281,6 +301,11 @@
86 if(itemY + articleItem.height > organicGridRoot.height) {
87 itemY = randomMargin();
88 xEdge = lastColumnX;
89+ if (alignIndex == 2)
90+ allowOneImgA = false
91+ }
92+ else /*if (alignIndex == 2)*/ {
93+ allowOneImgA = true
94 }
95
96 // The xEdge is where the last "column" of items were placed last
97
98=== modified file 'RssFeedPage.qml'
99--- RssFeedPage.qml 2013-10-05 10:51:56 +0000
100+++ RssFeedPage.qml 2013-10-06 13:56:25 +0000
101@@ -66,7 +66,7 @@
102
103 ToolbarButton {
104 action: Action {
105- text: rssItem == null ? "" : (rssItem.favourite == "0" ? i18n.tr("Save") : i18n.tr("Unsave"))
106+ text: rssItem == null ? "" : (rssItem.favourite == "0" ? i18n.tr("Save") : i18n.tr("Remove"))
107 iconSource: {
108 if (rssItem == null || rssItem.favourite == "0")
109 return Qt.resolvedUrl("./icons_tmp/favorite-unselected.svg")
110
111=== modified file 'article_items/ArticleFullImg.qml'
112--- article_items/ArticleFullImg.qml 2013-09-30 04:12:38 +0000
113+++ article_items/ArticleFullImg.qml 2013-10-06 13:56:25 +0000
114@@ -29,7 +29,7 @@
115 Item {
116 id: shapeClipper
117 width: parent.width
118- height: parent.height / 2
119+ height: uPic.height > (articleFullImg.height * 0.46) ? (articleFullImg.height * 0.46) : (uPic.height == 0 ? units.gu(1) : (uPic.height - units.gu(1.2)))
120 clip: true
121
122 UbuntuShape {
123@@ -59,20 +59,35 @@
124 id: content
125
126 anchors.top: shapeClipper.bottom
127+ anchors.topMargin: units.gu(1)
128 anchors.bottom: parent.bottom
129 anchors.bottomMargin: units.gu(1.5)
130 anchors.horizontalCenter: parent.horizontalCenter
131 width: parent.width - units.gu(2)
132 spacing: units.gu(0.8)
133
134- Label {
135- id: labelTime
136-
137- text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
138- fontSize: "x-small"
139+ Row {
140 width: parent.width
141- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
142- opacity: 0.6
143+ height: labelTime.paintedHeight
144+ spacing: units.gu(0.5)
145+
146+ Image {
147+ id: imgFavourite
148+ anchors.verticalCenter: labelTime.verticalCenter
149+ fillMode: Image.PreserveAspectCrop
150+ source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
151+ sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
152+ visible: modelItem.favourite == "1"
153+ }
154+
155+ Label {
156+ id: labelTime
157+ text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
158+ fontSize: "x-small"
159+ width: parent.width - units.gu(2)
160+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
161+ opacity: 0.6
162+ }
163 }
164
165 Label {
166
167=== modified file 'article_items/ArticleOneImgA.qml'
168--- article_items/ArticleOneImgA.qml 2013-09-30 04:12:38 +0000
169+++ article_items/ArticleOneImgA.qml 2013-10-06 13:56:25 +0000
170@@ -29,7 +29,7 @@
171 Item {
172 id: shapeClipper
173 width: parent.width
174- height: uPic.height > (articleOneImgA.height * 0.75) ? (articleOneImgA.height * 0.75) : uPic.height
175+ height: uPic.height > (articleOneImgA.height * 0.75) ? (articleOneImgA.height * 0.70) : (uPic.height == 0 ? units.gu(1) : (uPic.height - units.gu(1.3)))
176 clip: true
177
178 UbuntuShape {
179@@ -57,20 +57,35 @@
180
181 Column {
182 anchors {
183- left: parent.left; right: parent.right;
184 top: shapeClipper.bottom; bottom: parent.bottom
185- topMargin: units.gu(2); bottomMargin: units.gu(1.5);
186- leftMargin: units.gu(1); rightMargin: units.gu(1.5)
187+ topMargin: units.gu(1); bottomMargin: units.gu(1.5);
188 }
189+ anchors.horizontalCenter: parent.horizontalCenter
190+ width: parent.width - units.gu(2)
191 spacing: units.gu(1)
192
193- Label {
194- id: labelTime
195- text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
196- fontSize: "x-small"
197+ Row {
198 width: parent.width
199- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
200- opacity: 0.6
201+ height: labelTime.paintedHeight
202+ spacing: units.gu(0.5)
203+
204+ Image {
205+ id: imgFavourite
206+ anchors.verticalCenter: labelTime.verticalCenter
207+ fillMode: Image.PreserveAspectCrop
208+ source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
209+ sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
210+ visible: modelItem.favourite == "1"
211+ }
212+
213+ Label {
214+ id: labelTime
215+ text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
216+ fontSize: "x-small"
217+ width: parent.width - units.gu(2)
218+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
219+ opacity: 0.6
220+ }
221 }
222
223 Label {
224
225=== modified file 'article_items/ArticleTextA.qml'
226--- article_items/ArticleTextA.qml 2013-09-22 15:38:03 +0000
227+++ article_items/ArticleTextA.qml 2013-10-06 13:56:25 +0000
228@@ -34,13 +34,28 @@
229 }
230 spacing: units.gu(1)
231
232- Label {
233- id: labelTime
234- text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
235- fontSize: "x-small"
236+ Row {
237 width: parent.width
238- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
239- opacity: 0.6
240+ height: labelTime.paintedHeight
241+ spacing: units.gu(0.5)
242+
243+ Image {
244+ id: imgFavourite
245+ anchors.verticalCenter: labelTime.verticalCenter
246+ fillMode: Image.PreserveAspectCrop
247+ source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
248+ sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
249+ visible: modelItem.favourite == "1"
250+ }
251+
252+ Label {
253+ id: labelTime
254+ text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
255+ fontSize: "x-small"
256+ width: parent.width - units.gu(2)
257+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
258+ opacity: 0.6
259+ }
260 }
261
262 Label {
263
264=== modified file 'article_items/ArticleTextB.qml'
265--- article_items/ArticleTextB.qml 2013-09-22 15:38:03 +0000
266+++ article_items/ArticleTextB.qml 2013-10-06 13:56:25 +0000
267@@ -32,13 +32,28 @@
268 }
269 spacing: units.gu(1)
270
271- Label {
272- id: label_time
273- text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
274- fontSize: "x-small"
275+ Row {
276 width: parent.width
277- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
278- opacity: 0.6
279+ height: labelTime.paintedHeight
280+ spacing: units.gu(0.5)
281+
282+ Image {
283+ id: imgFavourite
284+ anchors.verticalCenter: labelTime.verticalCenter
285+ fillMode: Image.PreserveAspectCrop
286+ source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
287+ sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
288+ visible: modelItem.favourite == "1"
289+ }
290+
291+ Label {
292+ id: labelTime
293+ text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
294+ fontSize: "x-small"
295+ width: parent.width - units.gu(2)
296+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
297+ opacity: 0.6
298+ }
299 }
300
301 Label {
302@@ -46,7 +61,7 @@
303
304 text: invalid ? "" : modelItem.title
305 width: parent.width
306- height: parent.height - parent.spacing * 2 - label_time.paintedHeight - labelFeedname.paintedHeight
307+ height: parent.height - parent.spacing * 2 - labelTime.paintedHeight - labelFeedname.paintedHeight
308 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
309 fontSize: "small"
310 textFormat: Text.PlainText
311
312=== modified file 'rssreader-app.qml'
313--- rssreader-app.qml 2013-10-05 09:34:23 +0000
314+++ rssreader-app.qml 2013-10-06 13:56:25 +0000
315@@ -458,6 +458,7 @@
316
317 onFeedEdit: {
318 console.log("onFeedEdit: ", topicId)
319+ shortsTab.reload()
320 repeater.reloadOneTopic(topicId)
321 tabstabs.selectTopic(topicId)
322 }

Subscribers

People subscribed via source and target branches