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
1=== modified file 'OrganicGrid.qml'
2--- OrganicGrid.qml 2013-11-05 19:29:36 +0000
3+++ OrganicGrid.qml 2014-02-14 09:22:48 +0000
4@@ -9,6 +9,31 @@
5
6 anchors.fill: parent
7
8+ // comment 000 start
9+ // below property and slot are used for expanding app window in desktop mode
10+ property bool canReload: false
11+ onHeightChanged: {
12+ if (canReload) {
13+ canReload = false
14+ clear()
15+ reload()
16+ }
17+ }
18+
19+ // this value will be changed if the app's width changed
20+ property int numberAddMore: 12
21+ onWidthChanged: {
22+ var num = 12 * (1 + width / height)
23+ numberAddMore = num > 12 ? num : 12
24+ if (canReload) {
25+ canReload = false
26+ clear()
27+ reload()
28+ }
29+ }
30+
31+ // comment 000 end
32+
33 property var rectangleList: []
34 property var articleModel: gridViewModel
35
36@@ -18,6 +43,7 @@
37
38 Component.onCompleted: {
39 prepareComponents()
40+ canReload = true
41 }
42
43 property var delegateComponents: []
44@@ -75,7 +101,8 @@
45 if (amountToGo <= 0)
46 return
47
48- var numAdd = amountToGo > 12 ? 12 : amountToGo
49+ // change 12 to numberAddMore
50+ var numAdd = amountToGo > numberAddMore ? numberAddMore : amountToGo
51
52 console.time("loadmore")
53
54@@ -118,6 +145,7 @@
55 currentLoadedIndex = 0
56 loadMoreItems()
57 organicFlickable.scrollToStart()
58+ canReload = true
59 }
60
61 /*!
62
63=== modified file 'rssreader-app.qmlproject'
64--- rssreader-app.qmlproject 2013-09-26 08:44:17 +0000
65+++ rssreader-app.qmlproject 2014-02-14 09:22:48 +0000
66@@ -3,7 +3,7 @@
67 import QmlProject 1.1
68
69 Project {
70- mainFile: "rssreader-app.qml"
71+ mainFile: "shorts-app.qml"
72
73 /* Include .qml, .js, and image files from current directory and subdirectories */
74 QmlFiles {

Subscribers

People subscribed via source and target branches