Merge lp:~qqworini/ubuntu-rssreader-app/update-grid-to-desktop into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Joey Chan
Status: Merged
Approved by: Roman Shchekin
Approved revision: 173
Merged at revision: 174
Proposed branch: lp:~qqworini/ubuntu-rssreader-app/update-grid-to-desktop
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 74 lines (+30/-2)
2 files modified
OrganicGrid.qml (+29/-1)
rssreader-app.qmlproject (+1/-1)
To merge this branch: bzr merge lp:~qqworini/ubuntu-rssreader-app/update-grid-to-desktop
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Shorts Developers Pending
Review via email: mp+206362@code.launchpad.net

Commit message

update grid mode to make it adjustable for desktop mode

Description of the change

update grid mode to make it adjustable for desktop mode

* width and height changes will reload whole grid items to fill the app window

* splitted content not implemented yet

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-11-05 19:29:36 +0000
+++ OrganicGrid.qml 2014-02-14 09:22:48 +0000
@@ -9,6 +9,31 @@
99
10 anchors.fill: parent10 anchors.fill: parent
1111
12 // comment 000 start
13 // below property and slot are used for expanding app window in desktop mode
14 property bool canReload: false
15 onHeightChanged: {
16 if (canReload) {
17 canReload = false
18 clear()
19 reload()
20 }
21 }
22
23 // this value will be changed if the app's width changed
24 property int numberAddMore: 12
25 onWidthChanged: {
26 var num = 12 * (1 + width / height)
27 numberAddMore = num > 12 ? num : 12
28 if (canReload) {
29 canReload = false
30 clear()
31 reload()
32 }
33 }
34
35 // comment 000 end
36
12 property var rectangleList: []37 property var rectangleList: []
13 property var articleModel: gridViewModel38 property var articleModel: gridViewModel
1439
@@ -18,6 +43,7 @@
1843
19 Component.onCompleted: {44 Component.onCompleted: {
20 prepareComponents()45 prepareComponents()
46 canReload = true
21 }47 }
2248
23 property var delegateComponents: []49 property var delegateComponents: []
@@ -75,7 +101,8 @@
75 if (amountToGo <= 0)101 if (amountToGo <= 0)
76 return102 return
77103
78 var numAdd = amountToGo > 12 ? 12 : amountToGo104 // change 12 to numberAddMore
105 var numAdd = amountToGo > numberAddMore ? numberAddMore : amountToGo
79106
80 console.time("loadmore")107 console.time("loadmore")
81108
@@ -118,6 +145,7 @@
118 currentLoadedIndex = 0145 currentLoadedIndex = 0
119 loadMoreItems()146 loadMoreItems()
120 organicFlickable.scrollToStart()147 organicFlickable.scrollToStart()
148 canReload = true
121 }149 }
122150
123 /*!151 /*!
124152
=== modified file 'rssreader-app.qmlproject'
--- rssreader-app.qmlproject 2013-09-26 08:44:17 +0000
+++ rssreader-app.qmlproject 2014-02-14 09:22:48 +0000
@@ -3,7 +3,7 @@
3import QmlProject 1.13import QmlProject 1.1
44
5Project {5Project {
6 mainFile: "rssreader-app.qml"6 mainFile: "shorts-app.qml"
77
8 /* Include .qml, .js, and image files from current directory and subdirectories */8 /* Include .qml, .js, and image files from current directory and subdirectories */
9 QmlFiles {9 QmlFiles {

Subscribers

People subscribed via source and target branches