@@ -22,12 +22,11 @@ import "../../../qml/Components/ListItems" as ListItems
2222Column {
2323 id: socialAttributes
2424 spacing: units.gu(0.5)
25− height: divider.height + spacing + grid.height
2625
2726 property alias model: repeater.model
2827 property color color: theme.palette.normal.baseText
2928
30− signal clicked(var result)
29+ signal clicked(var actionId)
3130
3231 ListItems.ThinDivider {
3332 id: divider
@@ -35,32 +34,39 @@ Column {
3534 anchors { left: parent.left; right: parent.right; }
3635 }
3736
38− GridLayout {
39− id: grid
37+ Row {
38+ id: row
4039 anchors {
4140 left: parent.left
4241 right: parent.right
4342 leftMargin: units.gu(1)
4443 rightMargin: units.gu(1)
4544 }
46− columns: width > units.gu(12) ? 4 : 2
47− rowSpacing: units.gu(2)
45+ spacing: units.gu(2)
46+ readonly property int visibleItems: {
47+ if (width <= units.gu(12)) // small card
48+ return 2;
49+ else if (width <= units.gu(21)) // medium card
50+ return 3;
51+ else // large or horizontal card
52+ return 4;
53+ }
4854
4955 Repeater {
5056 id: repeater
51− delegate: Row {
52− objectName: "delegate" + index
53− spacing: units.gu(0.5)
57+ delegate: Loader {
5458 height: units.gu(2)
55− AbstractButton {
59+ active: index < row.visibleItems
60+ sourceComponent: AbstractButton {
61+ objectName: "delegate" + index
5662 height: units.gu(2)
5763 width: icon.width
5864 Icon {
5965 id: icon
6066 objectName: "icon"
6167
62− property url urlIcon: "icon" in modelData && modelData["icon"] || ""
63− property url urlTemporaryIcon: "temporaryIcon" in modelData && modelData["temporaryIcon"] || ""
68+ readonly property url urlIcon: "image://theme/ok"
69+ readonly property url urlTemporaryIcon: "temporaryIcon" in modelData && modelData["temporaryIcon"] || ""
6470
6571 height: units.gu(2)
6672 // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293