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
19 import "../../Components"
21 /*! This preview widget shows a horizontal list of images.
22 * The URIs for the images should be an array in widgetData["sources"].
27 implicitHeight: units.gu(22)
30 id: previewImageListView
33 orientation: ListView.Horizontal
34 cacheBuffer: width * 3
35 model: root.widgetData["sources"]
38 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
39 // we finally reached the point where this ListView doesn't correctly get swipe input any more but
40 // instead the parent ListView is the one that is swiped. This MouseArea sort of creates a blocking
41 // layer to make sure this ListView can be swiped, regardless of what's behind it.
44 enabled: parent.contentWidth > parent.width
47 // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
48 // we finally reached the point where this ListView doesn't correctly get swipe input any more but
49 // instead the parent ListView is the one that is swiped. This MouseArea sort of creates a blocking
50 // layer to make sure this ListView can be swiped, regardless of what's behind it.
53 enabled: parent.contentWidth > parent.width
57 objectName: "placeholderScreenshot"
63 source: "broken_image"
64 initialWidth: units.gu(13)
65 visible: previewImageListView.count == 0
73 source: modelData ? modelData : ""
75 initialWidth: units.gu(13)