@@ -26,8 +26,11 @@ PreviewWidget {
27 implicitHeight: units.gu(22)
27 implicitHeight: units.gu(22)
29+ property Item rootItem: QuickUtils.rootItem(root)
29 ListView {
31 ListView {
30 id: previewImageListView
32 id: previewImageListView
33+ objectName: "previewImageListView"
31 spacing: units.gu(1)
34 spacing: units.gu(1)
32 anchors.fill: parent
35 anchors.fill: parent
33 orientation: ListView.Horizontal
36 orientation: ListView.Horizontal
@@ -35,24 +38,6 @@ PreviewWidget {
35 model: root.widgetData["sources"]
38 model: root.widgetData["sources"]
36 clip: true
39 clip: true
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
56 LazyImage {
41 LazyImage {
57 objectName: "placeholderScreenshot"
42 objectName: "placeholderScreenshot"
@@ -66,6 +51,7 @@ PreviewWidget {
68 delegate: LazyImage {
53 delegate: LazyImage {
54+ objectName: "previewImage" + index
70 top: parent.top
56 top: parent.top
71 bottom: parent.bottom
57 bottom: parent.bottom
@@ -73,6 +59,123 @@ PreviewWidget {
73 source: modelData ? modelData : ""
59 source: modelData ? modelData : ""
74 scaleTo: "height"
60 scaleTo: "height"
75 initialWidth: units.gu(13)
61 initialWidth: units.gu(13)
62+ borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
68+ slideShowListView.currentIndex = index;
69+ slideShow.initialX = rootItem.mapFromItem(parent, 0, 0).x
70+ slideShow.initialY = rootItem.mapFromItem(parent, 0, 0).y
71+ slideShow.visible = true;
79+ objectName: "slideShow"
81+ readonly property real initialScale: previewImageListView.height / rootItem.height
82+ readonly property real scaleProgress: (scale - initialScale) / (1.0 - initialScale)
83+ property real initialX: 0
84+ property real initialY: 0
88+ height: parent.height
90+ clip: visible && scale < 1.0
91+ scale: visible ? 1.0 : initialScale
92+ transformOrigin: Item.TopLeft
93+ transform: Translate {
94+ x: slideShow.initialX - slideShow.initialX * slideShow.scaleProgress
95+ y: slideShow.initialY - slideShow.initialY * slideShow.scaleProgress
98+ radius: units.gu(1) - units.gu(1) * slideShow.scaleProgress
101+ enabled: !slideShow.visible
102+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
106+ id: slideShowListView
107+ objectName: "slideShowListView"
108+ anchors.fill: parent
109+ orientation: ListView.Horizontal
110+ highlightRangeMode: ListView.StrictlyEnforceRange
111+ highlightMoveDuration: 0
112+ snapMode: ListView.SnapOneItem
113+ boundsBehavior: Flickable.DragAndOvershootBounds
114+ model: root.widgetData["sources"]
120+ bottom: parent.bottom
122+ width: slideShow.width
123+ source: modelData ? modelData : ""
124+ fillMode: Image.PreserveAspectFit
125+ sourceSize { width: screenshot.width; height: screenshot.height }
129+ anchors.fill: parent
130+ onClicked: slideShowHeader.shown = !slideShowHeader.shown
137+ property bool shown: true
144+ visible: opacity > 0
145+ opacity: slideShow.scaleProgress > 0.6 && shown ? 0.8 : 0
148+ Behavior on opacity {
149+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
153+ id: slideShowCloseButton
154+ objectName: "slideShowCloseButton"
157+ bottom: parent.bottom
162+ onClicked: slideShow.visible = false
165+ anchors.fill: parent
166+ color: Qt.rgba(1.0, 1.0, 1.0, 0.3)
167+ visible: slideShowCloseButton.pressed
172+ anchors.centerIn: parent
173+ width: units.gu(2.5)
175+ color: Theme.palette.normal.foregroundText