proper image scaling with screen scaling (#3036, #3037)

This commit is contained in:
end-4
2026-05-04 09:20:12 +02:00
parent c652d2a7f3
commit f992294ec2
16 changed files with 20 additions and 41 deletions
@@ -88,8 +88,6 @@ Rectangle {
width: root.imageWidth * root.scale
height: root.imageHeight * root.scale
sourceSize.width: width
sourceSize.height: height
}
Loader {
@@ -7,7 +7,7 @@ import qs.modules.common.functions
// From https://github.com/caelestia-dots/shell with modifications.
// License: GPLv3
Image {
StyledImage {
id: root
required property var fileModelData
asynchronous: true
@@ -30,7 +30,7 @@ MaterialShape { // App icon
color: isUrgent ? Appearance.colors.colPrimaryContainer : Appearance.colors.colSecondaryContainer
Loader {
id: materialSymbolLoader
active: root.appIcon == ""
active: root.appIcon == "" && root.image == ""
anchors.fill: parent
sourceComponent: MaterialSymbol {
text: {
@@ -63,7 +63,7 @@ MaterialShape { // App icon
anchors.fill: parent
sourceComponent: Item {
anchors.fill: parent
Image {
StyledImage {
id: notifImage
anchors.fill: parent
readonly property int size: parent.width
@@ -74,11 +74,6 @@ MaterialShape { // App icon
antialiasing: true
asynchronous: true
width: size
height: size
sourceSize.width: size
sourceSize.height: size
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
@@ -1,4 +1,5 @@
import QtQuick
import Quickshell
import qs.services
import qs.modules.common
import qs.modules.common.widgets
@@ -22,4 +23,9 @@ Image {
currentFallbackIndex += 1;
}
}
sourceSize: {
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
return Qt.size(width * dpr, height * dpr);
}
}