@@ -0,0 +1,58 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.0
18+import "../../Components"
19+
20+/*! This preview widget shows a horizontal list of images.
21+ * The URIs for the images should be an array in widgetData["sources"].
22+ */
23+
24+PreviewWidget {
25+ id: root
26+ implicitHeight: units.gu(22)
27+
28+ ListView {
29+ id: previewImageListView
30+ spacing: units.gu(1)
31+ anchors.fill: parent
32+ orientation: ListView.Horizontal
33+ cacheBuffer: width * 3
34+ model: root.widgetData["sources"]
35+
36+ LazyImage {
37+ objectName: "placeholderScreenshot"
38+ anchors {
39+ top: parent.top
40+ bottom: parent.bottom
41+ }
42+ scaleTo: "height"
43+ source: "broken_image"
44+ initialWidth: units.gu(13)
45+ visible: previewImageListView.count == 0
46+ }
47+
48+ delegate: LazyImage {
49+ anchors {
50+ top: parent.top
51+ bottom: parent.bottom
52+ }
53+ source: modelData ? modelData : ""
54+ scaleTo: "height"
55+ initialWidth: units.gu(13)
56+ }
57+ }
58+}