on xenial help sign in
Updated zoomable image and video playback to fill the screen
7db4ef3Andrea Cimitan
qml/Components/LazyImage.qml+1
@@ -104,6 +104,7 @@ Item {
104 property url nextSource
104 property url nextSource
105 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
105 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
106
106
107+ anchors.fill: parent
107 visible: !useUbuntuShape
108 visible: !useUbuntuShape
108 fillMode: Image.PreserveAspectFit
109 fillMode: Image.PreserveAspectFit
109 asynchronous: true
110 asynchronous: true
qml/Dash/Previews/PreviewVideoPlayback.qml+1
@@ -51,6 +51,7 @@ PreviewWidget {
51 return "";
51 return "";
52 }
52 }
53 initialHeight: width * 10 / 16
53 initialHeight: width * 10 / 16
54+ useUbuntuShape: false
54
55
55 Image {
56 Image {
56 objectName: "playButton"
57 objectName: "playButton"
qml/Dash/Previews/PreviewZoomableImage.qml+7−6
@@ -27,22 +27,23 @@ import "../../Components"
27
27
28PreviewWidget {
28PreviewWidget {
29 id: root
29 id: root
30− implicitHeight: units.gu(22)
30+ implicitWidth: units.gu(35)
31+ implicitHeight: lazyImage.height
31
32
32 property Item rootItem: QuickUtils.rootItem(root)
33 property Item rootItem: QuickUtils.rootItem(root)
33
34
34 LazyImage {
35 LazyImage {
35 id: lazyImage
36 id: lazyImage
36 objectName: "lazyImage"
37 objectName: "lazyImage"
38+
37 anchors {
39 anchors {
38− top: parent.top
40+ left: parent.left
39− bottom: parent.bottom
41+ right: parent.right
40− horizontalCenter: parent.horizontalCenter
41 }
42 }
42− scaleTo: "height"
43+ scaleTo: "width"
43 source: widgetData["source"]
44 source: widgetData["source"]
44 asynchronous: true
45 asynchronous: true
45−
46+ useUbuntuShape: false
46 borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
47 borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
47
48
48 MouseArea {
49 MouseArea {
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+1−1
@@ -41,7 +41,7 @@ Rectangle {
41
41
42 Loader {
42 Loader {
43 id: loader
43 id: loader
44− anchors.centerIn: parent
44+ width: parent.width
45 sourceComponent: PreviewZoomableImage {
45 sourceComponent: PreviewZoomableImage {
46 widgetData: widgetData0
46 widgetData: widgetData0
47 }
47 }