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
=== modified file 'OrganicGrid.qml'
--- OrganicGrid.qml 2013-10-05 10:51:56 +0000
+++ OrganicGrid.qml 2013-10-06 13:56:25 +0000
@@ -19,6 +19,7 @@
19 property int lastColumnX : 019 property int lastColumnX : 0
20 property int itemY : randomMargin()20 property int itemY : randomMargin()
21 property var sequence : [0,1,0,1,2,1,0,0,2,1,0,1,0,0]21 property var sequence : [0,1,0,1,2,1,0,0,2,1,0,1,0,0]
22 property bool allowOneImgA: true
2223
23 property int currentLoadedIndex: 024 property int currentLoadedIndex: 0
2425
@@ -130,9 +131,16 @@
130 var imageArray = [article.image]131 var imageArray = [article.image]
131 var hasImage = (article.image !== "");132 var hasImage = (article.image !== "");
132133
133 // Pick the type of size we will use for this item from the sequence134
134 var sizeType = sequence[i % sequence.length];135 // var sizeType = sequence[i % sequence.length];
135 var alignType = Math.round(Math.random())136 // prevent two ImgOneA appear together
137 var alignType
138 do {
139 alignType = Math.round(Math.random())
140 if (allowOneImgA)
141 break
142 }
143 while (alignType == 0 && hasImage)
136144
137 var alignIndex145 var alignIndex
138146
@@ -145,12 +153,13 @@
145 alignIndex = 1153 alignIndex = 1
146 break;154 break;
147 }155 }
148 sizeType = 0;156// sizeType = 0;
149 }157 }
150 else {158 else {
151 switch(alignType) {159 switch(alignType) {
152 case 0:160 case 0:
153 alignIndex = 2161 alignIndex = 2
162// allowOneImgA = false
154 break;163 break;
155 case 1:164 case 1:
156 alignIndex = 3165 alignIndex = 3
@@ -173,6 +182,11 @@
173 if(itemY + articleItem.height > organicGridRoot.height) {182 if(itemY + articleItem.height > organicGridRoot.height) {
174 itemY = randomMargin();183 itemY = randomMargin();
175 xEdge = lastColumnX;184 xEdge = lastColumnX;
185 if (alignIndex == 2)
186 allowOneImgA = false
187 }
188 else /*if (alignIndex == 2)*/ {
189 allowOneImgA = true
176 }190 }
177191
178 // The xEdge is where the last "column" of items were placed last192 // The xEdge is where the last "column" of items were placed last
@@ -233,8 +247,14 @@
233 var hasImage = (article.image !== "");247 var hasImage = (article.image !== "");
234248
235 // Pick the type of size we will use for this item from the sequence249 // Pick the type of size we will use for this item from the sequence
236 var sizeType = sequence[i % sequence.length];250 // prevent two ImgOneA appear together
237 var alignType = Math.round(Math.random())251 var alignType
252 do {
253 alignType = Math.round(Math.random())
254 if (allowOneImgA)
255 break
256 }
257 while (alignType == 0 && hasImage)
238258
239 //var alignName259 //var alignName
240 var alignIndex260 var alignIndex
@@ -251,7 +271,7 @@
251 break;271 break;
252 }272 }
253 //noImageName += "NoImage";273 //noImageName += "NoImage";
254 sizeType = 0;274// sizeType = 0;
255 }275 }
256 else {276 else {
257 switch(alignType) {277 switch(alignType) {
@@ -281,6 +301,11 @@
281 if(itemY + articleItem.height > organicGridRoot.height) {301 if(itemY + articleItem.height > organicGridRoot.height) {
282 itemY = randomMargin();302 itemY = randomMargin();
283 xEdge = lastColumnX;303 xEdge = lastColumnX;
304 if (alignIndex == 2)
305 allowOneImgA = false
306 }
307 else /*if (alignIndex == 2)*/ {
308 allowOneImgA = true
284 }309 }
285310
286 // The xEdge is where the last "column" of items were placed last311 // The xEdge is where the last "column" of items were placed last
287312
=== modified file 'RssFeedPage.qml'
--- RssFeedPage.qml 2013-10-05 10:51:56 +0000
+++ RssFeedPage.qml 2013-10-06 13:56:25 +0000
@@ -66,7 +66,7 @@
6666
67 ToolbarButton {67 ToolbarButton {
68 action: Action {68 action: Action {
69 text: rssItem == null ? "" : (rssItem.favourite == "0" ? i18n.tr("Save") : i18n.tr("Unsave"))69 text: rssItem == null ? "" : (rssItem.favourite == "0" ? i18n.tr("Save") : i18n.tr("Remove"))
70 iconSource: {70 iconSource: {
71 if (rssItem == null || rssItem.favourite == "0")71 if (rssItem == null || rssItem.favourite == "0")
72 return Qt.resolvedUrl("./icons_tmp/favorite-unselected.svg")72 return Qt.resolvedUrl("./icons_tmp/favorite-unselected.svg")
7373
=== modified file 'article_items/ArticleFullImg.qml'
--- article_items/ArticleFullImg.qml 2013-09-30 04:12:38 +0000
+++ article_items/ArticleFullImg.qml 2013-10-06 13:56:25 +0000
@@ -29,7 +29,7 @@
29 Item {29 Item {
30 id: shapeClipper30 id: shapeClipper
31 width: parent.width31 width: parent.width
32 height: parent.height / 232 height: uPic.height > (articleFullImg.height * 0.46) ? (articleFullImg.height * 0.46) : (uPic.height == 0 ? units.gu(1) : (uPic.height - units.gu(1.2)))
33 clip: true33 clip: true
3434
35 UbuntuShape {35 UbuntuShape {
@@ -59,20 +59,35 @@
59 id: content59 id: content
6060
61 anchors.top: shapeClipper.bottom61 anchors.top: shapeClipper.bottom
62 anchors.topMargin: units.gu(1)
62 anchors.bottom: parent.bottom63 anchors.bottom: parent.bottom
63 anchors.bottomMargin: units.gu(1.5)64 anchors.bottomMargin: units.gu(1.5)
64 anchors.horizontalCenter: parent.horizontalCenter65 anchors.horizontalCenter: parent.horizontalCenter
65 width: parent.width - units.gu(2)66 width: parent.width - units.gu(2)
66 spacing: units.gu(0.8)67 spacing: units.gu(0.8)
6768
68 Label {69 Row {
69 id: labelTime
70
71 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
72 fontSize: "x-small"
73 width: parent.width70 width: parent.width
74 wrapMode: Text.WrapAtWordBoundaryOrAnywhere71 height: labelTime.paintedHeight
75 opacity: 0.672 spacing: units.gu(0.5)
73
74 Image {
75 id: imgFavourite
76 anchors.verticalCenter: labelTime.verticalCenter
77 fillMode: Image.PreserveAspectCrop
78 source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
79 sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
80 visible: modelItem.favourite == "1"
81 }
82
83 Label {
84 id: labelTime
85 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
86 fontSize: "x-small"
87 width: parent.width - units.gu(2)
88 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
89 opacity: 0.6
90 }
76 }91 }
7792
78 Label {93 Label {
7994
=== modified file 'article_items/ArticleOneImgA.qml'
--- article_items/ArticleOneImgA.qml 2013-09-30 04:12:38 +0000
+++ article_items/ArticleOneImgA.qml 2013-10-06 13:56:25 +0000
@@ -29,7 +29,7 @@
29 Item {29 Item {
30 id: shapeClipper30 id: shapeClipper
31 width: parent.width31 width: parent.width
32 height: uPic.height > (articleOneImgA.height * 0.75) ? (articleOneImgA.height * 0.75) : uPic.height32 height: uPic.height > (articleOneImgA.height * 0.75) ? (articleOneImgA.height * 0.70) : (uPic.height == 0 ? units.gu(1) : (uPic.height - units.gu(1.3)))
33 clip: true33 clip: true
3434
35 UbuntuShape {35 UbuntuShape {
@@ -57,20 +57,35 @@
5757
58 Column {58 Column {
59 anchors {59 anchors {
60 left: parent.left; right: parent.right;
61 top: shapeClipper.bottom; bottom: parent.bottom60 top: shapeClipper.bottom; bottom: parent.bottom
62 topMargin: units.gu(2); bottomMargin: units.gu(1.5);61 topMargin: units.gu(1); bottomMargin: units.gu(1.5);
63 leftMargin: units.gu(1); rightMargin: units.gu(1.5)
64 }62 }
63 anchors.horizontalCenter: parent.horizontalCenter
64 width: parent.width - units.gu(2)
65 spacing: units.gu(1)65 spacing: units.gu(1)
6666
67 Label {67 Row {
68 id: labelTime
69 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
70 fontSize: "x-small"
71 width: parent.width68 width: parent.width
72 wrapMode: Text.WrapAtWordBoundaryOrAnywhere69 height: labelTime.paintedHeight
73 opacity: 0.670 spacing: units.gu(0.5)
71
72 Image {
73 id: imgFavourite
74 anchors.verticalCenter: labelTime.verticalCenter
75 fillMode: Image.PreserveAspectCrop
76 source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
77 sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
78 visible: modelItem.favourite == "1"
79 }
80
81 Label {
82 id: labelTime
83 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
84 fontSize: "x-small"
85 width: parent.width - units.gu(2)
86 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
87 opacity: 0.6
88 }
74 }89 }
7590
76 Label {91 Label {
7792
=== modified file 'article_items/ArticleTextA.qml'
--- article_items/ArticleTextA.qml 2013-09-22 15:38:03 +0000
+++ article_items/ArticleTextA.qml 2013-10-06 13:56:25 +0000
@@ -34,13 +34,28 @@
34 }34 }
35 spacing: units.gu(1)35 spacing: units.gu(1)
3636
37 Label {37 Row {
38 id: labelTime
39 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
40 fontSize: "x-small"
41 width: parent.width38 width: parent.width
42 wrapMode: Text.WrapAtWordBoundaryOrAnywhere39 height: labelTime.paintedHeight
43 opacity: 0.640 spacing: units.gu(0.5)
41
42 Image {
43 id: imgFavourite
44 anchors.verticalCenter: labelTime.verticalCenter
45 fillMode: Image.PreserveAspectCrop
46 source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
47 sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
48 visible: modelItem.favourite == "1"
49 }
50
51 Label {
52 id: labelTime
53 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
54 fontSize: "x-small"
55 width: parent.width - units.gu(2)
56 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
57 opacity: 0.6
58 }
44 }59 }
4560
46 Label {61 Label {
4762
=== modified file 'article_items/ArticleTextB.qml'
--- article_items/ArticleTextB.qml 2013-09-22 15:38:03 +0000
+++ article_items/ArticleTextB.qml 2013-10-06 13:56:25 +0000
@@ -32,13 +32,28 @@
32 }32 }
33 spacing: units.gu(1)33 spacing: units.gu(1)
3434
35 Label {35 Row {
36 id: label_time
37 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
38 fontSize: "x-small"
39 width: parent.width36 width: parent.width
40 wrapMode: Text.WrapAtWordBoundaryOrAnywhere37 height: labelTime.paintedHeight
41 opacity: 0.638 spacing: units.gu(0.5)
39
40 Image {
41 id: imgFavourite
42 anchors.verticalCenter: labelTime.verticalCenter
43 fillMode: Image.PreserveAspectCrop
44 source: Qt.resolvedUrl("../icons_tmp/favorite-selected.svg")
45 sourceSize.height: modelItem.favourite == "1" ? units.gu(1.5) : 0
46 visible: modelItem.favourite == "1"
47 }
48
49 Label {
50 id: labelTime
51 text: { invalid ? "" : DateUtils.formatRelativeTime(i18n, modelItem.pubdate) }
52 fontSize: "x-small"
53 width: parent.width - units.gu(2)
54 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
55 opacity: 0.6
56 }
42 }57 }
4358
44 Label {59 Label {
@@ -46,7 +61,7 @@
4661
47 text: invalid ? "" : modelItem.title62 text: invalid ? "" : modelItem.title
48 width: parent.width63 width: parent.width
49 height: parent.height - parent.spacing * 2 - label_time.paintedHeight - labelFeedname.paintedHeight64 height: parent.height - parent.spacing * 2 - labelTime.paintedHeight - labelFeedname.paintedHeight
50 wrapMode: Text.WrapAtWordBoundaryOrAnywhere65 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
51 fontSize: "small"66 fontSize: "small"
52 textFormat: Text.PlainText67 textFormat: Text.PlainText
5368
=== modified file 'rssreader-app.qml'
--- rssreader-app.qml 2013-10-05 09:34:23 +0000
+++ rssreader-app.qml 2013-10-06 13:56:25 +0000
@@ -458,6 +458,7 @@
458458
459 onFeedEdit: {459 onFeedEdit: {
460 console.log("onFeedEdit: ", topicId)460 console.log("onFeedEdit: ", topicId)
461 shortsTab.reload()
461 repeater.reloadOneTopic(topicId)462 repeater.reloadOneTopic(topicId)
462 tabstabs.selectTopic(topicId)463 tabstabs.selectTopic(topicId)
463 }464 }

Subscribers

People subscribed via source and target branches