Merge lp:~qqworini/ubuntu-rssreader-app/fix-gridview-bug into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Joey Chan
Status: Merged
Approved by: Roman Shchekin
Approved revision: 177
Merged at revision: 177
Proposed branch: lp:~qqworini/ubuntu-rssreader-app/fix-gridview-bug
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 73 lines (+28/-16)
2 files modified
OrganicGrid.qml (+16/-16)
shorts-app.qml (+12/-0)
To merge this branch: bzr merge lp:~qqworini/ubuntu-rssreader-app/fix-gridview-bug
Reviewer Review Type Date Requested Status
Roman Shchekin Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+207234@code.launchpad.net

Commit message

update gridview to fix bug #1282002

Description of the change

update gridview to fix bug #1282002

also add a very important signal to mainView to tell others that App's size changed

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: Approve (continuous-integration)
Revision history for this message
Roman Shchekin (mrqtros) :
review: Approve

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 2014-02-14 08:27:12 +0000
3+++ OrganicGrid.qml 2014-02-19 15:43:07 +0000
4@@ -9,30 +9,30 @@
5
6 anchors.fill: parent
7
8- // comment 000 start
9+ // comment organicGridRoot_0 start
10 // below property and slot are used for expanding app window in desktop mode
11 property bool canReload: false
12- onHeightChanged: {
13- if (canReload) {
14- canReload = false
15- clear()
16- reload()
17- }
18- }
19
20 // this value will be changed if the app's width changed
21 property int numberAddMore: 12
22- onWidthChanged: {
23- var num = 12 * (1 + width / height)
24- numberAddMore = num > 12 ? num : 12
25- if (canReload) {
26- canReload = false
27- clear()
28- reload()
29+
30+ // connect to MainView's sizeChanged signal
31+ Connections{
32+ id: connMainview
33+ target: mainView
34+
35+ onSizeChanged: {
36+ var num = 12 * (1 + width / height)
37+ numberAddMore = num > 12 ? num : 12
38+ if (canReload) {
39+ canReload = false
40+ clear()
41+ reload()
42+ }
43 }
44 }
45
46- // comment 000 end
47+ // comment organicGridRoot_0 end
48
49 property var rectangleList: []
50 property var articleModel: gridViewModel
51
52=== modified file 'shorts-app.qml'
53--- shorts-app.qml 2014-02-13 03:55:55 +0000
54+++ shorts-app.qml 2014-02-19 15:43:07 +0000
55@@ -20,6 +20,18 @@
56 width: units.gu(50)
57 height: units.gu(75)
58
59+ // comment mainview_0 start
60+ // this signal will be triggered when size changed
61+ // PS: onSizeChanged slot doesn't work
62+ signal sizeChanged()
63+ onHeightChanged: {
64+ sizeChanged()
65+ }
66+ onWidthChanged: {
67+ sizeChanged()
68+ }
69+ // comment mainview_0 end
70+
71 headerColor: "#3a2c32"
72 backgroundColor: "#875864"
73 footerColor: "#9b616c"

Subscribers

People subscribed via source and target branches