@@ -0,0 +1,104 @@
2+ * Copyright (C) 2014 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18+import Ubuntu.Components 1.1;
20+import "../Components/ListItems" as ListItems
25+ property alias model: repeater.model
26+ property var scopeStyle
27+ property bool isFavoriteFeeds: false
29+ signal requestFavorite(string scopeId, bool favorite)
31+ implicitHeight: childrenRect.height
37+ text: isFavoriteFeeds ? i18n.tr("Favourite Feeds") : i18n.tr("Other Subscribed Feeds")
38+ color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
41+ property var myTemplate: JSON.parse('{"card-layout":"horizontal","card-size":"small","category-layout":"grid","collapsed-rows":2}')
42+ property var myComponents: JSON.parse('{"art":{"aspect-ratio":1,"field":"art"},"title":{"field":"title"},"attributes":{}}')
46+ anchors.top: header.bottom
53+ sourceComponent: Item {
59+ leftMargin: units.gu(1)
60+ verticalCenter: parent.verticalCenter
65+ source: model["art"] || ""
67+ fillMode: Image.PreserveAspectCrop
74+ leftMargin: units.gu(1)
76+ rightMargin: units.gu(1)
77+ verticalCenter: parent.verticalCenter
79+ text: model["title"] || ""
80+ elide: Text.ElideRight
83+ verticalAlignment: Text.AlignHCenter
89+ rightMargin: units.gu(1)
90+ verticalCenter: parent.verticalCenter
94+ source: isFavoriteFeeds ? "image://theme/starred" : "image://theme/non-starred"
97+ onClicked: root.requestFavorite(model.scopeId, !isFavoriteFeeds);