on xenial help sign in
make use of LazyImage in previews
commitcb27c5007cc7242b55c565bc5b17c0e4727f7914 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 2 Oct 2013, 11:54 (13 years ago) parent31ab388
2 files changed+10−22
Dash/Apps/AppPreview.qml+3−10 Dash/Generic/GenericPreview.qml+7−12
Dash/Apps/AppPreview.qml+3−10
@@ -42,21 +42,14 @@ GenericPreview {
4242 height: units.gu(22)
4343 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
4444
45− delegate: UbuntuShape {
45+ delegate: LazyImage {
4646 id: shape
4747 anchors {
4848 top: parent.top
4949 bottom: parent.bottom
5050 }
51− width: units.gu(12)
52− radius: "medium"
53− borderSource: ""
54− image: Image {
55− asynchronous: true
56− sourceSize { width: shape.width; height: shape.height }
57− source: modelData ? modelData : ""
58− fillMode: Image.PreserveAspectCrop
59− }
51+ source: modelData ? modelData : ""
52+ scaleTo: "height"
6053 }
6154 }
6255 }
Dash/Generic/GenericPreview.qml+7−12
@@ -33,19 +33,14 @@ DashPreview {
3333
3434 Component {
3535 id: previewImagesComponent
36− UbuntuShape {
37− id: urlLoader
38− anchors.left: parent.left
39− anchors.right: parent.right
40− height: width * previewImage.sourceSize.height / previewImage.sourceSize.width
41− radius: "medium"
42− visible: height > 0
43− image: Image {
44− id: previewImage
45− asynchronous: true
46− source: genericPreview.url
47− fillMode: Image.PreserveAspectCrop
36+ LazyImage {
37+ anchors {
38+ left: parent.left
39+ right: parent.right
4840 }
41+ scaleTo: "width"
42+ source: genericPreview.url
43+ height: implicitHeight
4944 }
5045 }
5146