@@ -0,0 +1,91 @@
2+ * Copyright 2016 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 QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.3
20+import "../../../qml/Components/ListItems" as ListItems
24+ height: divider.height + row.height + spacing
25+ spacing: units.gu(0.5)
27+ property alias model: repeater.model
28+ property color color: theme.palette.normal.baseText
29+ property real fontScale: 1.0
31+ signal clicked(var result)
33+ ListItems.ThinDivider {
35+ anchors { left: parent.left; right: parent.right; }
45+ leftMargin: units.gu(1)
46+ rightMargin: units.gu(1)
53+ objectName: "delegate" + index
54+ spacing: units.gu(0.5)
63+ property url urlIcon: "icon" in modelData && modelData["icon"] || ""
64+ property url urlTemporaryIcon: "temporaryIcon" in modelData && modelData["temporaryIcon"] || ""
67+ // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
68+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
70+ color: socialAttributes.color
72+ onUrlIconChanged: if (urlIcon) source = urlIcon
75+ onClicked: socialAttributes.clicked(modelData["id"]);
76+ onPressedChanged: if (pressed && icon.urlTemporaryIcon != "") icon.source = icon.urlTemporaryIcon
80+ anchors.verticalCenter: parent.verticalCenter
81+ text: "label" in modelData && modelData["label"] || "";
82+ elide: Text.ElideRight
85+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
86+ color: socialAttributes.color