Merge lp:~qqworini/ubuntu-rssreader-app/new-gridview2 into lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

Proposed by Joey Chan
Status: Merged
Approved by: Roman Shchekin
Approved revision: 56
Merged at revision: 56
Proposed branch: lp:~qqworini/ubuntu-rssreader-app/new-gridview2
Merge into: lp:~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk
Diff against target: 1673 lines (+318/-1074)
12 files modified
ListColumnDelegate.qml (+0/-62)
ListColumnView.qml (+0/-119)
OrganicGrid.qml (+227/-0)
RssFeedPage.qml (+3/-3)
TopicTab.qml (+3/-3)
addDelegate.js (+0/-153)
article_items/ArticleFullImg.qml (+31/-91)
article_items/ArticleOneImgA.qml (+25/-85)
article_items/ArticleOneImgB.qml (+0/-180)
article_items/ArticleTextA.qml (+15/-59)
article_items/ArticleTextB.qml (+14/-63)
article_items/ArticleTwoImgA.qml (+0/-256)
To merge this branch: bzr merge lp:~qqworini/ubuntu-rssreader-app/new-gridview2
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Roman Shchekin Approve
Review via email: mp+183377@code.launchpad.net

Commit message

what's new:
1. new grid view with new layout algorithm;
2. article items updated;

to do:
1. memory management of the new grid view;
2. read and unread indicate (need to modify the database first);
3. order articles;

Description of the change

what's new:
1. new grid view with new layout algorithm;
2. article items updated;

to do:
1. memory management of the new grid view;
2. read and unread indicate (need to modify the database first);
3. order articles;

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
David Planella (dpm) wrote :

Hi Joey, really nice work!

Just two quick comments:

- There is an autopilot test that is failing. I believe either the test or Jenkins needs updating to clear the database on each run, as looking at the autopilot video [1] it seems it fails trying to create a topic that it already exists
- To make your life easier for next time, there is no need to create a new branch and a new merge proposal when you fix conflicts. The procedure is simply.
  1. bzr merge lp:ubuntu-rss-reader-app to merge the latest trunk
  2. Fix any merge conflicts, either automatically or manually
  3. Commit and push the new revisions
  4. Then the merge proposal is automatically updated for you

[1] http://91.189.93.70:8080/job/generic-mediumtests/132/artifact/ubuntu_rssreader_app.tests.test_rssreader.TestMainWindow.test_add_remove_feed_and_topic%20(with%20mouse).ogv

Revision history for this message
Joey Chan (qqworini) wrote :

Hi David,
1. do I need to do something for the autopilot test?
2. I did try to fix conflicts in that branch, but I got some errors from "Bazaar Explorer", a bzr GUI client. then, I uploaded it to a new branch. Maybe my revision is too old to merge :P

> Hi Joey, really nice work!
>
> Just two quick comments:
>
> - There is an autopilot test that is failing. I believe either the test or
> Jenkins needs updating to clear the database on each run, as looking at the
> autopilot video [1] it seems it fails trying to create a topic that it already
> exists
> - To make your life easier for next time, there is no need to create a new
> branch and a new merge proposal when you fix conflicts. The procedure is
> simply.
> 1. bzr merge lp:ubuntu-rss-reader-app to merge the latest trunk
> 2. Fix any merge conflicts, either automatically or manually
> 3. Commit and push the new revisions
> 4. Then the merge proposal is automatically updated for you
>
> [1] http://91.189.93.70:8080/job/generic-mediumtests/132/artifact/ubuntu_rssre
> ader_app.tests.test_rssreader.TestMainWindow.test_add_remove_feed_and_topic%20
> (with%20mouse).ogv

Revision history for this message
Joey Chan (qqworini) wrote :

Could someone take a time to review?

Revision history for this message
Roman Shchekin (mrqtros) wrote :

I can review today, little but later! =)

03.09.13 17:05 Joey Chan написал(а):

Could someone take a time to review?

--
https://code.launchpad.net/~qqworini/ubuntu-rssreader-app/new-gridview2/+merge/183377

Your team Ubuntu RSS Feed Reader Developers is requested to review the proposed merge of lp:~qqworini/ubuntu-rssreader-app/new-gridview2 into lp:ubuntu-rssreader-app.

Revision history for this message
Roman Shchekin (mrqtros) wrote :

Looks like you are on the right way :)

review: Approve
Revision history for this message
David Planella (dpm) wrote :

On Mon, Sep 2, 2013 at 10:11 AM, Joey Chan <email address hidden> wrote:

> Hi David,
> 1. do I need to do something for the autopilot test?
>

Hi Joey,

I've ask Nick Skaggs, our QA Comunity Coordinator to help you on this. You
can also find him on IRC as 'balloons' in the #ubuntu-app-devel channel on
Freenode.

> 2. I did try to fix conflicts in that branch, but I got some errors from
> "Bazaar Explorer", a bzr GUI client. then, I uploaded it to a new branch.
> Maybe my revision is too old to merge :P
>

No worries, no need to change anything now, I just thought I'd mention it
to make your life easier.

Roman, if you're happy with the code after your review, please feel free to
top-approve so that the merge proposal can land (to top-approve, just click
on the Needs Review link at the top of the merge proposal's page).

>
> > Hi Joey, really nice work!
> >
> > Just two quick comments:
> >
> > - There is an autopilot test that is failing. I believe either the test
> or
> > Jenkins needs updating to clear the database on each run, as looking at
> the
> > autopilot video [1] it seems it fails trying to create a topic that it
> already
> > exists
> > - To make your life easier for next time, there is no need to create a
> new
> > branch and a new merge proposal when you fix conflicts. The procedure is
> > simply.
> > 1. bzr merge lp:ubuntu-rss-reader-app to merge the latest trunk
> > 2. Fix any merge conflicts, either automatically or manually
> > 3. Commit and push the new revisions
> > 4. Then the merge proposal is automatically updated for you
> >
> > [1]
> http://91.189.93.70:8080/job/generic-mediumtests/132/artifact/ubuntu_rssre
> >
> ader_app.tests.test_rssreader.TestMainWindow.test_add_remove_feed_and_topic%20
> > (with%20mouse).ogv
> --
>
> https://code.launchpad.net/~qqworini/ubuntu-rssreader-app/new-gridview2/+merge/183377
> Your team Ubuntu RSS Feed Reader Developers is requested to review the
> proposed merge of lp:~qqworini/ubuntu-rssreader-app/new-gridview2 into
> lp:ubuntu-rssreader-app.
>

Revision history for this message
Roman Shchekin (mrqtros) wrote :

Hi, David!

Thanks for your tips ;)

2013/9/3 David Planella <email address hidden>

> On Mon, Sep 2, 2013 at 10:11 AM, Joey Chan <email address hidden> wrote:
>
> > Hi David,
> > 1. do I need to do something for the autopilot test?
> >
>
> Hi Joey,
>
> I've ask Nick Skaggs, our QA Comunity Coordinator to help you on this. You
> can also find him on IRC as 'balloons' in the #ubuntu-app-devel channel on
> Freenode.
>
>
> > 2. I did try to fix conflicts in that branch, but I got some errors from
> > "Bazaar Explorer", a bzr GUI client. then, I uploaded it to a new branch.
> > Maybe my revision is too old to merge :P
> >
>
> No worries, no need to change anything now, I just thought I'd mention it
> to make your life easier.
>
> Roman, if you're happy with the code after your review, please feel free to
> top-approve so that the merge proposal can land (to top-approve, just click
> on the Needs Review link at the top of the merge proposal's page).
>
>
> >
> > > Hi Joey, really nice work!
> > >
> > > Just two quick comments:
> > >
> > > - There is an autopilot test that is failing. I believe either the test
> > or
> > > Jenkins needs updating to clear the database on each run, as looking at
> > the
> > > autopilot video [1] it seems it fails trying to create a topic that it
> > already
> > > exists
> > > - To make your life easier for next time, there is no need to create a
> > new
> > > branch and a new merge proposal when you fix conflicts. The procedure
> is
> > > simply.
> > > 1. bzr merge lp:ubuntu-rss-reader-app to merge the latest trunk
> > > 2. Fix any merge conflicts, either automatically or manually
> > > 3. Commit and push the new revisions
> > > 4. Then the merge proposal is automatically updated for you
> > >
> > > [1]
> >
> http://91.189.93.70:8080/job/generic-mediumtests/132/artifact/ubuntu_rssre
> > >
> >
> ader_app.tests.test_rssreader.TestMainWindow.test_add_remove_feed_and_topic%20
> > > (with%20mouse).ogv
> > --
> >
> >
> https://code.launchpad.net/~qqworini/ubuntu-rssreader-app/new-gridview2/+merge/183377
> > Your team Ubuntu RSS Feed Reader Developers is requested to review the
> > proposed merge of lp:~qqworini/ubuntu-rssreader-app/new-gridview2 into
> > lp:ubuntu-rssreader-app.
> >
>
> --
>
> https://code.launchpad.net/~qqworini/ubuntu-rssreader-app/new-gridview2/+merge/183377
> You are reviewing the proposed merge of
> lp:~qqworini/ubuntu-rssreader-app/new-gridview2 into
> lp:ubuntu-rssreader-app.
>

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
=== removed file 'ListColumnDelegate.qml'
--- ListColumnDelegate.qml 2013-08-03 10:06:36 +0000
+++ ListColumnDelegate.qml 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1import QtQuick 2.0
2
3import Ubuntu.Components 0.1
4import Ubuntu.Components.ListItems 0.1 as ListItem
5import Ubuntu.Components.Popups 0.1
6
7import "./addDelegate.js" as AddD
8import "./imgSeparator.js" as ImgS
9//import "./article_items"
10
11Column {
12 id: rss_item_delegate
13// width: units.gu(50)
14// height: units.gu(75)
15
16// height: parent.height
17 spacing: units.gu(2)
18
19 property bool isFull: false
20 property real childrenSumHeight: 0
21 property real childrenMaxWidth: 0
22 property int modelIndex
23
24 function addItem(rss_item, rss_description, model, index)
25 {
26 var newD = AddD.addDelegate(rss_item, ImgS.separate(rss_description), model, index, rss_item_delegate);
27 getChildrenRect() ;
28 rss_item_delegate.width = childrenMaxWidth ;
29// console.log("childrenSumHeight, column.height: ", childrenSumHeight, rss_item_delegate.childrenRect.height)
30 //console.log("children list: ", rss_item_delegate.children.length)
31 if (childrenSumHeight > rss_item_delegate.height + units.gu(2))
32 {
33 isFull = true ;
34 newD.destroy() ;
35 getChildrenRect() ;
36 rss_item_delegate.width = childrenMaxWidth ;
37// rss_item_delegate.children[rss_item_delegate.children.length-1].destroy() ;
38// rss_item_delegate.spacing = (childrenSumHeight - rss_item_delegate.height) / (rss_item_delegate.children.length + 2)
39 return false ;
40 }
41 else
42 {
43 isFull = false ;
44 return true ;
45 }
46 }
47
48 function getChildrenRect()
49 {
50 childrenSumHeight = 0 ;
51 childrenMaxWidth = 0 ;
52 var length = rss_item_delegate.children.length ;
53 for (var i=0; i<length; i++)
54 {
55 childrenSumHeight += (rss_item_delegate.children[i].height + units.gu(2) * length) ;
56 if (rss_item_delegate.children[i].width > childrenMaxWidth)
57 {
58 childrenMaxWidth = rss_item_delegate.children[i].width
59 }
60 }
61 }
62}
630
=== removed file 'ListColumnView.qml'
--- ListColumnView.qml 2013-08-16 16:22:59 +0000
+++ ListColumnView.qml 1970-01-01 00:00:00 +0000
@@ -1,119 +0,0 @@
1import QtQuick 2.0
2import QtQuick.XmlListModel 2.0
3import Ubuntu.Components 0.1
4import Ubuntu.Components.ListItems 0.1 as ListItem
5import Ubuntu.Components.Popups 0.1
6
7import "databasemodule_v2.js" as DB
8
9Item {
10
11 property int tag_id
12 property bool isAll: false
13 property variant feedArray: []
14 property alias rss_model: tempmodel
15
16 anchors.fill: parent
17 anchors.bottomMargin: units.gu(7)
18
19 function reload() {
20 tempmodel.clear();
21 if (!isAll)
22 {
23 for (var j=0; j < feedArray.length ; j++)
24 {
25 var articles = DB.loadArticles({"isAll": false, "feedId": feedArray[j].id});
26 var temp
27 for (var i=0; i < articles.rows.length; i++)
28 {
29 temp =
30 {
31 "id": articles.rows[i].id
32 ,"title": articles.rows[i].title
33 ,"content": articles.rows[i].content
34 ,"link": articles.rows[i].link
35 ,"description": articles.rows[i].description
36 ,"pubdate": articles.rows[i].pubdate
37 ,"status": articles.rows[i].status
38 ,"favourite": articles.rows[i].favourite
39 ,"image": articles.rows[i].image
40 ,"guid": articles.rows[i].guid
41 ,"feed_id": articles.rows[i].feed_id
42 ,"count": articles.rows[i].count
43 ,"feed_name": articles.rows[i].feed_name
44 }
45 tempmodel.append(temp);
46 }
47 }
48 }
49 else
50 {
51 var articles = DB.loadArticles({"isAll": true});
52 var temp
53 for (var i=0; i < articles.rows.length; i++)
54 {
55 temp =
56 {
57 "id": articles.rows[i].id
58 ,"title": articles.rows[i].title
59 ,"content": articles.rows[i].content
60 ,"link": articles.rows[i].link
61 ,"description": articles.rows[i].description
62 ,"pubdate": articles.rows[i].pubdate
63 ,"status": articles.rows[i].status
64 ,"favourite": articles.rows[i].favourite
65 ,"image": articles.rows[i].image
66 ,"guid": articles.rows[i].guid
67 ,"feed_id": articles.rows[i].feed_id
68 ,"count": articles.rows[i].count
69 ,"feed_name": articles.rows[i].feed_name
70 }
71 tempmodel.append(temp);
72 }
73 }
74
75// console.timeEnd("model append");
76 list_column.loadArticles();
77 }
78
79
80 ListView {
81 id: list_column
82
83 anchors.fill: parent
84 anchors.margins: units.gu(2)
85 orientation: ListView.Horizontal
86 spacing: units.gu(3)
87 cacheBuffer: 99999
88
89 function loadArticles(/*temp_model*/) {
90 console.time("loadArticles: ");
91 column_model.clear() ;
92 column_model.append( { "nothing": "nothing" } ) ;
93 currentIndex = 0 ;
94
95 for (var i=0; i< tempmodel.count; i++)
96 {
97 while (!currentItem.addItem(tempmodel.get(i), tempmodel.get(i).content, tempmodel, i))
98 {
99 column_model.append( { "nothing": "nothing" } ) ;
100 currentIndex = column_model.count - 1 ;
101 }
102 }
103
104 positionViewAtBeginning() ;
105 console.timeEnd("loadArticles: ");
106 }
107
108 model: ListModel { id: column_model }
109
110 delegate: ListColumnDelegate {
111 height: list_column.height
112 modelIndex: index
113 }
114 }
115
116 ListModel {
117 id: tempmodel
118 }
119}
1200
=== added file 'OrganicGrid.qml'
--- OrganicGrid.qml 1970-01-01 00:00:00 +0000
+++ OrganicGrid.qml 2013-09-02 04:22:41 +0000
@@ -0,0 +1,227 @@
1import QtQuick 2.0
2import QtGraphicalEffects 1.0
3import Ubuntu.Components 0.1
4import "databasemodule_v2.js" as DB
5import "./imgSeparator.js" as ImageSeparator
6
7Item {
8 id: organicGridRoot
9
10 anchors.fill: parent
11
12 property variant rectangleList: []
13 property int tag_id
14 property bool isAll: false
15 property variant feedArray: []
16
17 /*!
18 * \brief check collision of two article items
19 *
20 */
21 function checkCollision(rect1, rect2) {
22 return !((rect1.y + rect1.height <= rect2.y) ||
23 (rect2.y + rect2.height <= rect1.y) ||
24 (rect1.x >= rect2.x + rect2.width) ||
25 (rect2.x >= rect1.x + rect1.width))
26 }
27
28 /*!
29 * \brief Returns a margin within given numbers. Used to make the view
30 * look more organic.
31 */
32 function randomMargin() {
33 return units.gu(2 /*3 + Math.random() * 4*/);
34 }
35
36 /*!
37 * Adds a given article to the model. Also adds metadata about the
38 * model to the article.
39 */
40 function addArticleToModel(article) {
41 article.model = articleModel
42 article.modelIndex = articleModel.count
43 articleModel.append(article)
44 }
45
46
47 /*!
48 * Clears all articles from the model and the view.
49 */
50 function clear() {
51 for(var i in rectangleList) {
52 rectangleList[i].destroy()
53 }
54
55 articleModel.clear()
56 rectangleList = []
57 }
58
59 /*!
60 * Reloads the organic view. See inline comments for details.
61 */
62 function reload() {
63 clear()
64 // Decide if we should load all articles in our database or a subset.
65 if (!isAll)
66 {
67 for (var j=0; j < feedArray.length ; j++)
68 {
69 var feedArticles = DB.loadArticles({"isAll": false, "feedId": feedArray[j].id});
70 for(var i = 0; i < feedArticles.rows.length; i++) {
71 addArticleToModel(feedArticles.rows[i])
72 }
73 }
74 } else {
75 var feedArticles = DB.loadArticles({"isAll": true});
76 for (var i=0; i < feedArticles.rows.length; i++)
77 {
78 addArticleToModel(feedArticles.rows[i])
79 }
80 }
81
82 // Initial values for the starting column of items
83 var xEdge = 0;
84 var lastColumnX = 0;
85 var y = randomMargin();
86 // A hard-coded sequence that gives an organic look, but is not
87 // completely random
88 var sequence = [0,1,0,1,2,1,0,0,2,1,0,1,0,0];
89 // TODO: Remove hard limit on 300 items
90 for(var i = 0; i < articleModel.count; i++) {
91 var article = articleModel.get(i);
92// var imageArray = ImageSeparator.separate(article.content)
93 var imageArray = [article.image]
94// console.log("imageArray: ", imageArray)
95 var hasImage = (article.image !== "");
96
97 // Pick the type of size we will use for this item from the sequence
98 var sizeType = sequence[i % sequence.length];
99 var alignType = parseInt(Math.random() * 2)
100// if(hasImage) {
101// alignType = parseInt(Math.random() * 4);
102// } else {
103// alignType = parseInt(Math.random() * 2);
104// }
105
106 var alignName
107
108 // Name of the QML file to be used
109 var componentName
110 var noImageName = ""
111 if(!hasImage) {
112 switch(alignType) {
113 case 0:
114 alignName = "TextA"
115 break;
116 case 1:
117 alignName = "TextB"
118 break;
119 }
120 noImageName += "NoImage";
121 sizeType = 0;
122 }
123 else {
124 switch(alignType) {
125 case 0:
126 alignName = "OneImgA"
127 break;
128 case 1:
129 alignName = "FullImg"
130 break;
131 }
132 }
133 componentName = "article_items/" + "Article" + alignName + ".qml";
134
135 // create component for an article
136 var component = Qt.createComponent(componentName);
137 if(component.status !== Component.Ready) {
138 console.log("Error loading component:", component.errorString());
139 continue; // Skip if we for some reason could not create this component
140 }
141
142 var properties = {
143 "rss_item": article,
144 "imageArray": imageArray,
145 "rss_model": articleModel,
146 "model_index": article.modelIndex
147 }
148
149 // This is the actual item that will be on display
150 var articleItem = component.createObject(itemContainer /*organicFlickable.contentItem*/, properties);
151
152 if(y + articleItem.height > organicGridRoot.height) {
153 y = randomMargin();
154 xEdge = lastColumnX;
155 }
156
157 // The xEdge is where the last "column" of items were placed last
158 // This keeps us moving forward in x-direction
159 var x = xEdge + randomMargin();
160
161 // We add some extra random margin to make it look a bit more organic
162 x += randomMargin();
163
164 articleItem.x = x
165 articleItem.y = y
166
167 // Check for collisions with all other items
168 // TODO: See if this may be limited to only the previous two colums
169 for(var j = 0; j < rectangleList.length; j++) {
170 var rect2 = rectangleList[j]
171 if(checkCollision(articleItem, rect2)) {
172 articleItem.x = rect2.x + rect2.width + randomMargin();
173 }
174 }
175
176 // Did we move the x-edge value further to the right than before?
177 lastColumnX = Math.max(articleItem.x, lastColumnX);
178
179 // Push this item to all lists and all that stuff
180 var list = rectangleList
181 list.push(articleItem)
182 rectangleList = list
183
184 // Increment y for the next item
185 y += articleItem.height + randomMargin();
186 }
187 organicFlickable.scrollToStart()
188 }
189
190 /*!
191 * use Flickable as articles container
192 */
193 Flickable {
194 id: organicFlickable
195 anchors.fill: parent
196 contentWidth: itemContainer.width /*contentItem.childrenRect.width*/
197 contentHeight: parent.height
198
199 Item {
200 id: itemContainer
201 // color: "white"
202 anchors {
203 left: parent.left
204 top: parent.top
205 }
206
207 width: childrenRect.width + units.gu(6)
208 height: parent.height
209 }
210
211// Behavior on contentX {
212// NumberAnimation {
213// duration: 600
214// easing.type: Easing.InOutQuart
215// }
216// }
217
218 function scrollToStart() {
219 contentX = 0
220 }
221 }
222
223 ListModel
224 {
225 id: articleModel
226 }
227}
0228
=== modified file 'RssFeedPage.qml'
--- RssFeedPage.qml 2013-09-01 09:07:30 +0000
+++ RssFeedPage.qml 2013-09-02 04:22:41 +0000
@@ -98,7 +98,7 @@
9898
99 Label {99 Label {
100 id: label_time100 id: label_time
101 text: DateUtils.formatRelativeTime(i18n, model.pubdate)101 text: DateUtils.formatRelativeTime(i18n, pubdate)
102 fontSize: "small"102 fontSize: "small"
103 anchors.horizontalCenter: parent.horizontalCenter103 anchors.horizontalCenter: parent.horizontalCenter
104 width: parent.width - units.gu(4)104 width: parent.width - units.gu(4)
@@ -106,14 +106,14 @@
106106
107 Label {107 Label {
108 fontSize: "large"108 fontSize: "large"
109 text: model.title109 text: title
110 anchors.horizontalCenter: parent.horizontalCenter110 anchors.horizontalCenter: parent.horizontalCenter
111 width: parent.width - units.gu(4)111 width: parent.width - units.gu(4)
112 wrapMode: Text.WrapAtWordBoundaryOrAnywhere112 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
113 }113 }
114114
115 Label {115 Label {
116 text: model.content116 text: content
117 linkColor: UbuntuColors.orange // Temporary. Mb bad color, but better than dark blue.117 linkColor: UbuntuColors.orange // Temporary. Mb bad color, but better than dark blue.
118 anchors.horizontalCenter: parent.horizontalCenter118 anchors.horizontalCenter: parent.horizontalCenter
119 width: parent.width - units.gu(4)119 width: parent.width - units.gu(4)
120120
=== modified file 'TopicTab.qml'
--- TopicTab.qml 2013-09-01 14:35:33 +0000
+++ TopicTab.qml 2013-09-02 04:22:41 +0000
@@ -63,11 +63,11 @@
63 feeds.push(feedTags.rows.item(i))63 feeds.push(feedTags.rows.item(i))
64 }64 }
65 feedArray = feeds65 feedArray = feeds
66 listColumnView.reload()66 organicGridView.reload()
67 }67 }
6868
69 ListColumnView {69 OrganicGrid {
70 id: listColumnView70 id: organicGridView
7171
72 tag_id: topicTab.topicId72 tag_id: topicTab.topicId
73 isAll: topicTab.isAll73 isAll: topicTab.isAll
7474
=== removed file 'addDelegate.js'
--- addDelegate.js 2013-08-03 10:06:36 +0000
+++ addDelegate.js 1970-01-01 00:00:00 +0000
@@ -1,153 +0,0 @@
1//var component;
2//var sprite;
3
4//var mob_component;
5//var mob_sprite;
6
7function addDelegate(rss_item, imageArray, model, index, parentItem)
8{
9// console.log("add delegate start")
10// component = undefined ;
11// sprite = undefined ;
12
13// console.time("add delegate");
14 var rand = Math.random() ;
15 rand = Math.round(rand * 100)
16 var newD
17 if (imageArray.length == 1)
18 {
19
20// console.log("rand value: ", rand)
21 /*else*/ if (rand < 35)
22 {
23 // component = Qt.createComponent("./ArticledelegateOneImgB.qml");
24 // sprite = component.createObject(rss_item_delegate, {"rss_title": rss_title, "imageArray": imageArray});
25 // console.log("delegate BBBBB")
26 newD = delegateOneImgA (rss_item, imageArray, model, index, parentItem)
27 }
28 else if (rand > 70)
29 {
30 // component = Qt.createComponent("./ArticledelegateOneImgA.qml");
31 // sprite = component.createObject(rss_item_delegate, {"rss_title": rss_title, "imageArray": imageArray});
32 // console.log("delegate AAAAA")
33 newD = delegateOneImgB (rss_item, imageArray, model, index, parentItem)
34 }
35 else
36 {
37 newD = delegateFullImg (rss_item, imageArray, model, index, parentItem)
38 }
39
40 }
41 else if (imageArray.length < 1)
42 {
43 if (rand > 50)
44 {
45 newD = delegateTextA (rss_item/*, imageArray*/, model, index, parentItem) ;
46 }
47 else
48 {
49 newD = delegateTextB (rss_item/*, imageArray*/, model, index, parentItem) ;
50 }
51 }
52 else
53 {
54 newD = delegateTwoImgA (rss_item, imageArray, model, index, parentItem)
55 }
56
57 return newD ;
58}
59
60function delegateOneImgA (rss_item, imageArray, model, index, parentItem)
61{
62 var component;
63 var sprite;
64 component = Qt.createComponent("./article_items/ArticleOneImgA.qml");
65 sprite = component.createObject(parentItem, {"rss_item": rss_item, "imageArray": imageArray, "rss_model": model, "model_index": index});
66// console.log("delegate AAAAA")
67
68 if (sprite == null) {
69 // Error Handling
70 console.log("Error creating delegate object delegateOneImgA");
71 return
72 }
73 return sprite
74}
75
76function delegateOneImgB (rss_item, imageArray, model, index, parentItem)
77{
78 var component;
79 var sprite;
80 component = Qt.createComponent("./article_items/ArticleOneImgB.qml");
81 sprite = component.createObject(parentItem, {"rss_item": rss_item, "imageArray": imageArray, "rss_model": model, "model_index": index});
82// console.log("delegate BBBBB")
83
84 if (sprite == null) {
85 // Error Handling
86 console.log("Error creating delegate object delegateOneImgB");
87 return
88 }
89 return sprite
90}
91
92function delegateTextA (rss_item, model, index, parentItem)
93{
94 var component;
95 var sprite;
96 component = Qt.createComponent("./article_items/ArticleTextA.qml");
97 sprite = component.createObject(parentItem, {"rss_item": rss_item, "rss_model": model, "model_index": index});
98// console.log("delegate CCCCC")
99
100 if (sprite == null) {
101 // Error Handling
102 console.log("Error creating delegate object delegateTextA");
103 return
104 }
105 return sprite
106}
107
108function delegateTextB (rss_item, model, index, parentItem)
109{
110 var component;
111 var sprite;
112 component = Qt.createComponent("./article_items/ArticleTextB.qml");
113 sprite = component.createObject(parentItem, {"rss_item": rss_item, "rss_model": model, "model_index": index});
114// console.log("delegate CCCCC")
115
116 if (sprite == null) {
117 // Error Handling
118 console.log("Error creating delegate object delegateTextB");
119 return
120 }
121 return sprite
122}
123
124function delegateFullImg (rss_item, imageArray, model, index, parentItem)
125{
126 var component;
127 var sprite;
128 component = Qt.createComponent("./article_items/ArticleFullImg.qml");
129 sprite = component.createObject(parentItem, {"rss_item": rss_item, "imageArray": imageArray, "rss_model": model, "model_index": index});
130// console.log("delegate DDDDD")
131
132 if (sprite == null) {
133 // Error Handling
134 console.log("Error creating delegate object delegateFullImg");
135 return
136 }
137 return sprite
138}
139
140function delegateTwoImgA (rss_item, imageArray, model, index, parentItem)
141{
142 var component;
143 var sprite;
144 component = Qt.createComponent("./article_items/ArticleTwoImgA.qml");
145 sprite = component.createObject(parentItem, {"rss_item": rss_item, "imageArray": imageArray, "rss_model": model, "model_index": index});
146
147 if (sprite == null) {
148 // Error Handling
149 console.log("Error creating delegate object delegateTwoImgA");
150 return
151 }
152 return sprite
153}
1540
=== modified file 'article_items/ArticleFullImg.qml'
--- article_items/ArticleFullImg.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleFullImg.qml 2013-09-02 04:22:41 +0000
@@ -7,46 +7,56 @@
7{7{
8 id: articleFullImg8 id: articleFullImg
9 width: units.gu(24)9 width: units.gu(24)
10 height: units.gu(19)10 height: units.gu(20)
11 radius: "medium"11 radius: "medium"
12 // anchors.fill: parent12 color: "#3E2930"
13
13 property variant rss_item14 property variant rss_item
14 property variant imageArray: []15 property variant imageArray: []
15 property variant rss_model16 property variant rss_model
16 property int model_index17 property int model_index
1718
18 image: Image {19 UbuntuShape
19 id: pic20 {
20 width: articleFullImg.width21 id: u_pic
21// anchors.top: articleFullImg.top22 width: parent.width
22 fillMode: Image.PreserveAspectCrop23 height: pic.height > (parent.height - units.gu(1.5)) ? (parent.height - units.gu(1.5)) : pic.height
23 source: imageArray[0]24 radius: "medium"
25 image: Image {
26 id: pic
27 width: u_pic.width
28 source: imageArray[0]
29 }
24 }30 }
2531
26 Rectangle32 Rectangle
27 {33 {
28 id: rec_label_bg34 id: rec_label_bg
29 color: "black"35 color: "#3E2930"
30 anchors.top: content.top36 anchors.top: content.top
31 anchors.bottom: content.bottom37 anchors.bottom: content.bottom
32 width: parent.width38 width: parent.width
33 opacity: 0.739 opacity: 1
34 }40 }
3541
36 Column42 Column
37 {43 {
38 id: content44 id: content
39 anchors.bottom: parent.bottom45 anchors.bottom: parent.bottom
40 anchors.bottomMargin: units.gu(1)46 anchors.bottomMargin: units.gu(1.5)
41 anchors.horizontalCenter: parent.horizontalCenter47 anchors.horizontalCenter: parent.horizontalCenter
42 width: parent.width - units.gu(1)48 width: parent.width - units.gu(2)
43 spacing: units.gu(1)49 height: parent.height / 2.3
50 spacing: units.gu(0.8)
4451
45 Label52 Label
46 {53 {
47 id: label_time54 id: label_time
48 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)55 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
49 fontSize: "small"56 fontSize: "x-small"
57 width: parent.width
58 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
59 opacity: 0.6
50 }60 }
5161
52 Label62 Label
@@ -54,20 +64,23 @@
54 id: label_title64 id: label_title
55 text: rss_item.title65 text: rss_item.title
56 width: parent.width66 width: parent.width
67 height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
57 wrapMode: Text.WrapAtWordBoundaryOrAnywhere68 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
58 // color: "white"69 fontSize: "small"
59 fontSize: "medium"70 textFormat: Text.PlainText
60 textFormat: Text.StyledText
61 font.weight: Font.DemiBold71 font.weight: Font.DemiBold
72 elide: Text.ElideRight
73 opacity: 0.8
62 }74 }
6375
64 Label76 Label
65 {77 {
66 id: label_feedname78 id: label_feedname
67 text: rss_item.feed_name79 text: rss_item.feed_name
68 fontSize: "small"80 fontSize: "x-small"
69 width: parent.width81 width: parent.width
70 wrapMode: Text.WrapAtWordBoundaryOrAnywhere82 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
83 opacity: 0.6
71 }84 }
72 }85 }
7386
@@ -81,76 +94,3 @@
81 }94 }
82 }95 }
83}96}
84
85//Column {
86// width: units.gu(26)
87// height: units.gu(20)
88// // anchors.fill: parent
89// property variant rss_item
90// property variant imageArray: []
91// property variant rss_model
92// property int model_index
93
94// // Row
95// // {
96// // spacing: units.gu(1)
97// // anchors.fill: parent
98// //// layoutDirection: Qt.RightToLeft
99
100// UbuntuShape
101// {
102// id: u_pic
103// width: units.gu(24)
104// height: units.gu(17)
105// image: Image {
106// id: pic
107// width: units.gu(24)
108// fillMode: Image.PreserveAspectCrop
109// source: imageArray[0]
110// }
111
112// Rectangle
113// {
114// id: rec_label_bg
115//// color: "black"
116// anchors.top: label_title.top
117// anchors.bottom: label_title.bottom
118// width: parent.width
119// opacity: 0.5
120// }
121
122// Label
123// {
124// id: label_title
125// text: rss_item.title
126// anchors.bottom: parent.bottom
127// anchors.bottomMargin: units.gu(1)
128// anchors.horizontalCenter: parent.horizontalCenter
129// width: parent.width - units.gu(1)
130// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
131//// color: "white"
132// fontSize: "medium"
133// textFormat: Text.StyledText
134// }
135
136// MouseArea
137// {
138// anchors.fill: parent
139
140// onClicked:
141// {
142// mainView.toRssPage(rss_model, model_index) ;
143// }
144// }
145// }
146
147// Label
148// {
149// id: label_time
150// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
151//// color: "black"
152// fontSize: "medium"
153// }
154
155// // }
156//}
15797
=== modified file 'article_items/ArticleOneImgA.qml'
--- article_items/ArticleOneImgA.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleOneImgA.qml 2013-09-02 04:22:41 +0000
@@ -5,27 +5,27 @@
55
6UbuntuShape6UbuntuShape
7{7{
8 width: units.gu(20)8 width: units.gu(18)
9 height: content.height + units.gu(1.5)9 height: units.gu(33) /*content.height + units.gu(1.5)*/
10 radius: "medium"10 radius: "medium"
11 color: "#3D3028"11 color: "#5C3B42"
1212
13 property variant rss_item13 property variant rss_item
14 property variant imageArray: []14 property variant imageArray: []
15 property variant rss_model15 property variant rss_model
16 property int model_index16 property int model_index
1717
18 Column18// Column
19 {19// {
20 id: content20// id: content
21 anchors{ left: parent.left; right: parent.right }21// anchors{ left: parent.left; right: parent.right }
22 spacing: units.gu(1)22// spacing: units.gu(1)
2323
24 UbuntuShape24 UbuntuShape
25 {25 {
26 id: u_pic26 id: u_pic
27 width: parent.width27 width: parent.width
28 height: pic.height > units.gu(12) ? pic.height : units.gu(12)28 height: pic.height /*> units.gu(12) ? pic.height : units.gu(12)*/
29 radius: "medium"29 radius: "medium"
30 image: Image {30 image: Image {
31 id: pic31 id: pic
@@ -37,41 +37,49 @@
3737
38 Column38 Column
39 {39 {
40 anchors{ left: parent.left; right: parent.right; margins: units.gu(2) }40 anchors {
41 left: parent.left; right: parent.right;
42 top: u_pic.bottom; bottom: parent.bottom
43 topMargin: units.gu(2); bottomMargin: units.gu(1.5);
44 leftMargin: units.gu(1); rightMargin: units.gu(1.5)
45 }
41 spacing: units.gu(1)46 spacing: units.gu(1)
4247
43 Label48 Label
44 {49 {
45 id: label_time50 id: label_time
46 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)51 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
47 fontSize: "small"52 fontSize: "x-small"
48 // horizontalAlignment: Text.AlignRight
49 width: parent.width53 width: parent.width
54 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
55 opacity: 0.6
50 }56 }
5157
52 Label58 Label
53 {59 {
54 id: label_title60 id: label_title
55 text: rss_item.title61 text: rss_item.title
56 // anchors.horizontalCenter: parent.horizontalCenter
57 width: parent.width62 width: parent.width
63 height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
58 wrapMode: Text.WrapAtWordBoundaryOrAnywhere64 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
59 fontSize: "medium"65 fontSize: "small"
60 textFormat: Text.PlainText66 textFormat: Text.PlainText
61 // horizontalAlignment: Text.AlignRight
62 font.weight: Font.DemiBold67 font.weight: Font.DemiBold
68 elide: Text.ElideRight
69 opacity: 0.8
63 }70 }
6471
65 Label72 Label
66 {73 {
67 id: label_feedname74 id: label_feedname
68 text: rss_item.feed_name75 text: rss_item.feed_name
69 fontSize: "small"76 fontSize: "x-small"
70 width: parent.width77 width: parent.width
71 wrapMode: Text.WrapAtWordBoundaryOrAnywhere78 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
79 opacity: 0.6
72 }80 }
73 }81 }
74 }82// }
7583
76 MouseArea84 MouseArea
77 {85 {
@@ -83,71 +91,3 @@
83 }91 }
84 }92 }
85}93}
86
87//Column {
88// id: delegate_item
89// width: units.gu(34)
90//// height: units.gu(16)
91//// anchors.fill: parent
92// property variant rss_item
93// property variant imageArray: []
94// property variant rss_model
95// property int model_index
96
97// Row
98// {
99// id: row
100// spacing: units.gu(1)
101//// anchors.fill: parent
102
103// Label
104// {
105// id: label_title
106// text: rss_item.title
107//// anchors.horizontalCenter: parent.horizontalCenter
108// width: units.gu(14)
109// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
110//// color: "black"
111// fontSize: "medium"
112// textFormat: Text.PlainText
113// horizontalAlignment: Text.AlignRight
114
115
116// }
117
118// UbuntuShape
119// {
120// id: u_pic
121// width: units.gu(18)
122// height: pic.height
123// image: Image {
124// id: pic
125// width: units.gu(18)
126// fillMode: Image.PreserveAspectFit
127// source: imageArray[0]
128//// {
129//// if (imageArray == 0)
130//// {
131//// label_title.width = units.gu(30)
132//// label_title.fontSize = "large"
133//// return ""
134//// }
135//// else if (imageArray.length > 0)
136//// return imageArray[0]
137//// }
138// }
139// }
140
141
142// }
143
144// Label
145// {
146// id: label_time
147// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
148//// color: "black"
149// fontSize: "medium"
150// horizontalAlignment: Text.AlignRight
151// width: parent.width
152// }
153//}
15494
=== removed file 'article_items/ArticleOneImgB.qml'
--- article_items/ArticleOneImgB.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleOneImgB.qml 1970-01-01 00:00:00 +0000
@@ -1,180 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.ListItems 0.1 as ListItem
4import "../dateutils.js" as DateUtils
5
6UbuntuShape
7{
8 width: units.gu(20)
9 height: content.height + units.gu(1.5)
10 radius: "medium"
11 color: "#3D3028"
12
13 property variant rss_item
14 property variant imageArray: []
15 property variant rss_model
16 property int model_index
17
18 Column
19 {
20 id: content
21 anchors{ left: parent.left; right: parent.right; bottom: parent.bottom }
22 spacing: units.gu(1)
23
24 Column
25 {
26 anchors{ left: parent.left; right: parent.right; margins: units.gu(2) }
27 spacing: units.gu(1)
28
29 Label
30 {
31 id: label_time
32 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
33 fontSize: "small"
34 // horizontalAlignment: Text.AlignRight
35 width: parent.width
36 }
37
38 Label
39 {
40 id: label_title
41 text: rss_item.title
42 // anchors.horizontalCenter: parent.horizontalCenter
43 width: parent.width
44 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
45 fontSize: "medium"
46 textFormat: Text.PlainText
47 // horizontalAlignment: Text.AlignRight
48 font.weight: Font.DemiBold
49 }
50
51 Label
52 {
53 id: label_feedname
54 text: rss_item.feed_name
55 fontSize: "small"
56 width: parent.width
57 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
58 }
59 }
60
61 UbuntuShape
62 {
63 id: u_pic
64 width: parent.width
65 height: pic.height > units.gu(12) ? pic.height : units.gu(12)
66 radius: "medium"
67 image: Image {
68 id: pic
69 width: u_pic.width
70 fillMode: Image.PreserveAspectFit
71 source: imageArray[0]
72 }
73 }
74 }
75
76 MouseArea
77 {
78 anchors.fill: parent
79
80 onClicked:
81 {
82 mainView.toRssPage(rss_model, model_index) ;
83 }
84 }
85}
86
87//Column {
88// id: delegate_item
89// width: units.gu(34)
90//// height: units.gu(16)
91//// anchors.fill: parent
92// property variant rss_item
93// property variant imageArray: []
94// property variant rss_model
95// property int model_index
96
97// Row
98// {
99// id: row
100// spacing: units.gu(1)
101//// anchors.fill: parent
102//// layoutDirection: Qt.RightToLeft
103
104
105
106// UbuntuShape
107// {
108// id: u_pic
109// width: units.gu(18)
110// height: pic.height
111// image: Image {
112// id: pic
113// width: units.gu(18)
114// fillMode: Image.PreserveAspectFit
115// source: imageArray[0]
116//// {
117//// if (imageArray == 0)
118//// {
119//// label_title.width = units.gu(30)
120//// label_title.fontSize = "large"
121//// return ""
122//// }
123//// else if (imageArray.length > 0)
124//// return imageArray[0]
125//// }
126// }
127
128// MouseArea
129// {
130// x:0; y:0
131// width: delegate_item.width
132// height: delegate_item.height
133
134// onClicked:
135// {
136// mainView.toRssPage(rss_model, model_index) ;
137// }
138// }
139// }
140
141// Label
142// {
143// id: label_title
144// text: rss_item.title
145//// anchors.horizontalCenter: parent.horizontalCenter
146// width: units.gu(14)
147// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
148//// color: "black"
149// fontSize: "medium"
150// textFormat: Text.StyledText
151// }
152
153//// Image {
154//// id: pic
155//// width: units.gu(18)
156//// fillMode: Image.PreserveAspectFit
157//// source: imageArray[0]
158//// {
159//// if (imageArray == undefined)
160//// {
161//// return ""
162//// }
163//// else if (imageArray.length > 0)
164//// return imageArray[0]
165////// else
166////// return ""
167//// }
168//// anchors.centerIn: parent
169//// anchors.verticalCenter: parent.verticalCenter
170//// }
171// }
172
173// Label
174// {
175// id: label_time
176// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
177//// color: "black"
178// fontSize: "medium"
179// }
180//}
1810
=== modified file 'article_items/ArticleTextA.qml'
--- article_items/ArticleTextA.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleTextA.qml 2013-09-02 04:22:41 +0000
@@ -5,8 +5,8 @@
55
6UbuntuShape6UbuntuShape
7{7{
8 width: units.gu(16)8 width: units.gu(11)
9 height: content.height + units.gu(4)9 height: units.gu(20) /*content.height + units.gu(4)*/
10 color: "#32222C"10 color: "#32222C"
11 radius: "medium"11 radius: "medium"
1212
@@ -18,16 +18,21 @@
18 Column18 Column
19 {19 {
20 id: content20 id: content
21 anchors{ left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }21// anchors{ left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }
22 anchors {
23 fill: parent; topMargin: units.gu(2); bottomMargin: units.gu(1.5);
24 leftMargin: units.gu(1); rightMargin: units.gu(1.5)
25 }
22 spacing: units.gu(1)26 spacing: units.gu(1)
2327
24 Label28 Label
25 {29 {
26 id: label_time30 id: label_time
27 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)31 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
28 fontSize: "small"32 fontSize: "x-small"
29 width: parent.width33 width: parent.width
30 wrapMode: Text.WrapAtWordBoundaryOrAnywhere34 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
35 opacity: 0.6
31 }36 }
3237
33 Label38 Label
@@ -35,19 +40,23 @@
35 id: label_title40 id: label_title
36 text: rss_item.title41 text: rss_item.title
37 width: parent.width42 width: parent.width
43 height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
38 wrapMode: Text.WrapAtWordBoundaryOrAnywhere44 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
39 fontSize: "medium"45 fontSize: "small"
40 textFormat: Text.PlainText46 textFormat: Text.PlainText
41 font.weight: Font.DemiBold47 font.weight: Font.DemiBold
48 elide: Text.ElideRight
49 opacity: 0.8
42 }50 }
4351
44 Label52 Label
45 {53 {
46 id: label_feedname54 id: label_feedname
47 text: rss_item.feed_name55 text: rss_item.feed_name
48 fontSize: "small"56 fontSize: "x-small"
49 width: parent.width57 width: parent.width
50 wrapMode: Text.WrapAtWordBoundaryOrAnywhere58 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
59 opacity: 0.6
51 }60 }
52 }61 }
5362
@@ -62,56 +71,3 @@
62 }71 }
63}72}
6473
65//Column {
66// width: units.gu(30)
67//// height: units.gu(15)
68//// anchors.fill: parent
69// property variant rss_item
70// property variant imageArray: []
71// property variant rss_model
72// property int model_index
73
74//// Row
75//// {
76// spacing: units.gu(1)
77//// anchors.fill: parent
78
79// Label
80// {
81// id: label_title
82// text: rss_item.title
83//// anchors.horizontalCenter: parent.horizontalCenter
84// width: units.gu(30)
85// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
86//// color: "black"
87// fontSize: "large"
88// textFormat: Text.PlainText
89
90// MouseArea
91// {
92// anchors.fill: parent
93
94// onClicked:
95// {
96// mainView.toRssPage(rss_model, model_index) ;
97// }
98// }
99// }
100//// }
101
102// Label
103// {
104// id: label_time
105// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
106//// color: "black"
107// fontSize: "medium"
108// width: parent.width
109// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
110// }
111
112// Item
113// {
114// width: parent.width
115// height: units.gu(2)
116// }
117//}
11874
=== modified file 'article_items/ArticleTextB.qml'
--- article_items/ArticleTextB.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleTextB.qml 2013-09-02 04:22:41 +0000
@@ -6,7 +6,7 @@
6UbuntuShape6UbuntuShape
7{7{
8 width: units.gu(18)8 width: units.gu(18)
9 height: content.height + units.gu(4)9 height: units.gu(15) /*content.height + units.gu(4)*/
10 color: "#32222C"10 color: "#32222C"
11 radius: "medium"11 radius: "medium"
1212
@@ -18,17 +18,21 @@
18 Column18 Column
19 {19 {
20 id: content20 id: content
21 anchors{ left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }21// anchors{ left: parent.left; right: parent.right; margins: units.gu(2); verticalCenter: parent.verticalCenter }
22 anchors {
23 fill: parent; topMargin: units.gu(2); bottomMargin: units.gu(1.5);
24 leftMargin: units.gu(1); rightMargin: units.gu(1.5)
25 }
22 spacing: units.gu(1)26 spacing: units.gu(1)
2327
24 Label28 Label
25 {29 {
26 id: label_time30 id: label_time
27 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)31 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
28 fontSize: "small"32 fontSize: "x-small"
29 width: parent.width33 width: parent.width
30 wrapMode: Text.WrapAtWordBoundaryOrAnywhere34 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
31 horizontalAlignment: Text.AlignRight35 opacity: 0.6
32 }36 }
3337
34 Label38 Label
@@ -36,21 +40,23 @@
36 id: label_title40 id: label_title
37 text: rss_item.title41 text: rss_item.title
38 width: parent.width42 width: parent.width
43 height: parent.height - parent.spacing * 2 - label_time.paintedHeight - label_feedname.paintedHeight
39 wrapMode: Text.WrapAtWordBoundaryOrAnywhere44 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
40 fontSize: "medium"45 fontSize: "small"
41 textFormat: Text.PlainText46 textFormat: Text.PlainText
42 font.weight: Font.DemiBold47 font.weight: Font.DemiBold
43 horizontalAlignment: Text.AlignRight48 elide: Text.ElideRight
49 opacity: 0.8
44 }50 }
4551
46 Label52 Label
47 {53 {
48 id: label_feedname54 id: label_feedname
49 text: rss_item.feed_name55 text: rss_item.feed_name
50 fontSize: "small"56 fontSize: "x-small"
51 width: parent.width57 width: parent.width
52 wrapMode: Text.WrapAtWordBoundaryOrAnywhere58 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
53 horizontalAlignment: Text.AlignRight59 opacity: 0.6
54 }60 }
55 }61 }
5662
@@ -64,58 +70,3 @@
64 }70 }
65 }71 }
66}72}
67//Column {
68// width: units.gu(30)
69//// height: units.gu(15)
70//// anchors.fill: parent
71// property variant rss_item
72// property variant imageArray: []
73// property variant rss_model
74// property int model_index
75
76//// Row
77//// {
78// spacing: units.gu(1)
79//// anchors.fill: parent
80
81// Label
82// {
83// id: label_title
84// text: rss_item.title
85//// anchors.horizontalCenter: parent.horizontalCenter
86// width: units.gu(30)
87// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
88//// color: "black"
89// fontSize: "large"
90// textFormat: Text.PlainText
91// horizontalAlignment: Text.AlignRight
92
93// MouseArea
94// {
95// anchors.fill: parent
96
97// onClicked:
98// {
99// mainView.toRssPage(rss_model, model_index) ;
100// }
101// }
102// }
103//// }
104
105// Label
106// {
107// id: label_time
108// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
109//// color: "black"
110// fontSize: "medium"
111// horizontalAlignment: Text.AlignRight
112// width: parent.width
113// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
114// }
115
116// Item
117// {
118// width: parent.width
119// height: units.gu(2)
120// }
121//}
12273
=== removed file 'article_items/ArticleTwoImgA.qml'
--- article_items/ArticleTwoImgA.qml 2013-08-29 21:22:17 +0000
+++ article_items/ArticleTwoImgA.qml 1970-01-01 00:00:00 +0000
@@ -1,256 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.ListItems 0.1 as ListItem
4import "../dateutils.js" as DateUtils
5
6UbuntuShape
7{
8 width: units.gu(24)
9 height: content.height + units.gu(1.5)
10 radius: "medium"
11 color: "#3D3028"
12
13 property variant rss_item
14 property variant imageArray: []
15 property variant rss_model
16 property int model_index
17
18 Column
19 {
20 id: content
21 anchors{ left: parent.left; right: parent.right }
22 spacing: units.gu(1)
23
24 Row
25 {
26// anchors{ left: parent.left; right: parent.right }
27 height: u_pic.height > u_pic1.height ? u_pic.height : u_pic1.height
28
29 UbuntuShape
30 {
31 id: u_pic
32 width: content.width / 2
33 height: pic.height > units.gu(8) ? pic.height : units.gu(8)
34 radius: "medium"
35 image: Image {
36 id: pic
37 width: u_pic.width
38 fillMode: Image.PreserveAspectFit
39 source: imageArray[0]
40 }
41 }
42
43 UbuntuShape
44 {
45 id: u_pic1
46 width: content.width / 2
47 height: pic1.height > units.gu(8) ? pic1.height : units.gu(8)
48 radius: "medium"
49 image: Image {
50 id: pic1
51 width: u_pic1.width
52 fillMode: Image.PreserveAspectFit
53 source: imageArray[1]
54 }
55 }
56 }
57
58 Column
59 {
60 anchors{ left: parent.left; right: parent.right; margins: units.gu(2) }
61 spacing: units.gu(1)
62
63 Label
64 {
65 id: label_time
66 text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
67 fontSize: "small"
68 // horizontalAlignment: Text.AlignRight
69 width: parent.width
70 }
71
72 Label
73 {
74 id: label_title
75 text: rss_item.title
76 // anchors.horizontalCenter: parent.horizontalCenter
77 width: parent.width
78 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
79 fontSize: "medium"
80 textFormat: Text.PlainText
81 // horizontalAlignment: Text.AlignRight
82 font.weight: Font.DemiBold
83 }
84
85 Label
86 {
87 id: label_feedname
88 text: rss_item.feed_name
89 fontSize: "small"
90 width: parent.width
91 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
92 }
93 }
94 }
95
96 MouseArea
97 {
98 anchors.fill: parent
99
100 onClicked:
101 {
102 mainView.toRssPage(rss_model, model_index) ;
103 }
104 }
105}
106
107//Column {
108// id: delegate_item
109// width: units.gu(34)
110//// height: units.gu(16)
111//// anchors.fill: parent
112// property variant rss_item
113// property variant imageArray: []
114// property variant rss_model
115// property int model_index
116
117// Row
118// {
119// id: row
120// spacing: units.gu(1)
121//// anchors.fill: parent
122
123// Label
124// {
125// id: label_title
126// text: rss_item.title
127//// anchors.horizontalCenter: parent.horizontalCenter
128// width: units.gu(14)
129// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
130//// color: "black"
131// fontSize: "medium"
132// textFormat: Text.PlainText
133// horizontalAlignment: Text.AlignRight
134
135
136// }
137
138// UbuntuShape
139// {
140// id: u_pic
141// width: units.gu(18)
142// height: pic.height
143// image: Image {
144// id: pic
145// width: units.gu(18)
146// fillMode: Image.PreserveAspectFit
147// source: imageArray[0]
148//// {
149//// if (imageArray == 0)
150//// {
151//// label_title.width = units.gu(30)
152//// label_title.fontSize = "large"
153//// return ""
154//// }
155//// else if (imageArray.length > 0)
156//// return imageArray[0]
157//// }
158// }
159// }
160
161
162// }
163
164// Label
165// {
166// id: label_time
167// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
168//// color: "black"
169// fontSize: "medium"
170// horizontalAlignment: Text.AlignRight
171// width: parent.width
172// }
173//}
174
175
176//Column {
177// id: delegate_item
178// width: units.gu(34)
179//// height: units.gu(30)
180//// anchors.fill: parent
181// property variant rss_item
182// property variant imageArray: []
183// property variant rss_model
184// property int model_index
185
186// Row
187// {
188// id: row
189// spacing: units.gu(1)
190//// anchors.fill: parent
191
192// Label
193// {
194// id: label_title
195// text: rss_item.title
196//// anchors.horizontalCenter: parent.horizontalCenter
197// width: units.gu(14)
198// wrapMode: Text.WrapAtWordBoundaryOrAnywhere
199//// color: "black"
200// fontSize: "medium"
201// textFormat: Text.PlainText
202
203// MouseArea
204// {
205// x:0; y:0
206// width: delegate_item.width
207// height: delegate_item.height
208
209// onClicked:
210// {
211// mainView.toRssPage(rss_model, model_index) ;
212// }
213// }
214// }
215
216// Column
217// {
218// spacing: units.gu(1)
219
220// UbuntuShape
221// {
222// id: u_pic0
223// width: units.gu(15)
224// height: pic0.height
225// image: Image {
226// id: pic0
227// width: units.gu(15)
228// fillMode: Image.PreserveAspectFit
229// source: imageArray[0]
230// }
231// }
232
233// UbuntuShape
234// {
235// id: u_pic1
236// width: units.gu(15)
237// height: pic1.height
238// image: Image {
239// id: pic1
240// width: units.gu(15)
241// fillMode: Image.PreserveAspectFit
242// source: imageArray[1]
243// }
244// }
245// }
246
247// }
248
249// Label
250// {
251// id: label_time
252// text: DateUtils.formatRelativeTime(i18n, rss_item.pubdate)
253//// color: "black"
254// fontSize: "medium"
255// }
256//}

Subscribers

People subscribed via source and target branches