mirror of https://github.com/KDE/kasts.git
Workaround for mipmap issue with Image
See https://bugreports-test.qt.io/browse/QTBUG-105277 for background
This commit is contained in:
parent
acbf4c605f
commit
b6da9407c7
|
@ -137,8 +137,10 @@ FocusScope {
|
|||
Layout.preferredWidth: height
|
||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 1.5
|
||||
absoluteRadius: Kirigami.Units.smallSpacing
|
||||
|
||||
// resizing the image is very stuttering when the header is resized; relying on mipmap to do the smoothing
|
||||
imageResize: false
|
||||
mipmap: true
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
|
|
@ -25,15 +25,6 @@ Item {
|
|||
property bool isLoading: false
|
||||
property int imageFillMode: Image.PreserveAspectCrop
|
||||
property bool imageResize: true
|
||||
property bool mipmap: false
|
||||
|
||||
// HACK: if mipmap has been set to true, then reset it AFTER image has
|
||||
// changed, otherwise it will be ignored
|
||||
onImageSourceChanged: {
|
||||
if (root.mipmap) {
|
||||
root.mipmap = true;
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: imageLoader
|
||||
|
@ -67,10 +58,17 @@ Item {
|
|||
anchors.fill: parent
|
||||
source: root.imageSource
|
||||
fillMode: root.imageFillMode
|
||||
asynchronous: true
|
||||
|
||||
// mipmap = smooth image at smaller sizes than original
|
||||
// needs to be a fixed value; bindings will break the behaviour,
|
||||
// see: https://bugreports-test.qt.io/browse/QTBUG-105277
|
||||
mipmap: true
|
||||
|
||||
// still resizing images despite mipmap for non-resizable images
|
||||
// since it gives much better (i.e. non-blurry) results
|
||||
sourceSize.width: root.imageResize ? width * Screen.devicePixelRatio : 0
|
||||
sourceSize.height: root.imageResize ? height * Screen.devicePixelRatio : 0
|
||||
asynchronous: true
|
||||
mipmap: root.mipmap
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue