on xenial help sign in
Updated zoomable image and video playback to fill the screen
commit7db4ef3aae2fc84e21a605018b37ba12d2a9fdaf authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 1 Oct 2015, 12:08 (11 years ago) parente63b276
4 files changed+10−7
qml/Components/LazyImage.qml+1 qml/Dash/Previews/PreviewVideoPlayback.qml+1 qml/Dash/Previews/PreviewZoomableImage.qml+7−6 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+1−1
qml/Components/LazyImage.qml+1
@@ -104,6 +104,7 @@ Item {
104104 property url nextSource
105105 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
106106
107+ anchors.fill: parent
107108 visible: !useUbuntuShape
108109 fillMode: Image.PreserveAspectFit
109110 asynchronous: true
qml/Dash/Previews/PreviewVideoPlayback.qml+1
@@ -51,6 +51,7 @@ PreviewWidget {
5151 return "";
5252 }
5353 initialHeight: width * 10 / 16
54+ useUbuntuShape: false
5455
5556 Image {
5657 objectName: "playButton"
qml/Dash/Previews/PreviewZoomableImage.qml+7−6
@@ -27,22 +27,23 @@ import "../../Components"
2727
2828PreviewWidget {
2929 id: root
30− implicitHeight: units.gu(22)
30+ implicitWidth: units.gu(35)
31+ implicitHeight: lazyImage.height
3132
3233 property Item rootItem: QuickUtils.rootItem(root)
3334
3435 LazyImage {
3536 id: lazyImage
3637 objectName: "lazyImage"
38+
3739 anchors {
38− top: parent.top
39− bottom: parent.bottom
40− horizontalCenter: parent.horizontalCenter
40+ left: parent.left
41+ right: parent.right
4142 }
42− scaleTo: "height"
43+ scaleTo: "width"
4344 source: widgetData["source"]
4445 asynchronous: true
45−
46+ useUbuntuShape: false
4647 borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
4748
4849 MouseArea {
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+1−1
@@ -41,7 +41,7 @@ Rectangle {
4141
4242 Loader {
4343 id: loader
44− anchors.centerIn: parent
44+ width: parent.width
4545 sourceComponent: PreviewZoomableImage {
4646 widgetData: widgetData0
4747 }