fix: handle hidpi for rest of sourceSize uses
This commit is contained in:
parent
dea8efcc97
commit
775d0a8101
9 changed files with 30 additions and 15 deletions
|
|
@ -184,8 +184,10 @@ Item {
|
|||
source: Players.getArtUrl(Players.active)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
sourceSize: {
|
||||
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||
return Qt.size(width * dpr, height * dpr);
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
import Quickshell
|
||||
import Caelestia.Config
|
||||
import Caelestia.Services
|
||||
import qs.components
|
||||
|
|
@ -109,8 +110,10 @@ Item {
|
|||
source: Players.getArtUrl(Players.active)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
sourceSize: {
|
||||
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||
return Qt.size(width * dpr, height * dpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Caelestia.Config
|
||||
import qs.components
|
||||
import qs.components.effects
|
||||
|
|
@ -22,8 +23,10 @@ Item {
|
|||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
sourceSize: {
|
||||
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||
return Qt.size(width * dpr, height * dpr);
|
||||
}
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ ColumnLayout {
|
|||
asynchronous: true
|
||||
source: Paths.absolutePath(Config.paths.lockNoNotifsPic)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: clipRect.width * 0.8
|
||||
sourceSize.width: clipRect.width * 0.8 * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1)
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: Colouriser {
|
||||
|
|
|
|||
|
|
@ -73,8 +73,10 @@ StyledRect {
|
|||
Image {
|
||||
source: Qt.resolvedUrl(root.image)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||
sourceSize: {
|
||||
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||
return Qt.size(size, size);
|
||||
}
|
||||
cache: false
|
||||
asynchronous: true
|
||||
width: TokenConfig.sizes.notifs.image
|
||||
|
|
|
|||
|
|
@ -126,8 +126,10 @@ StyledRect {
|
|||
anchors.fill: parent
|
||||
source: Qt.resolvedUrl(root.modelData.image)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||
sourceSize: {
|
||||
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||
return Qt.size(size, size);
|
||||
}
|
||||
cache: false
|
||||
asynchronous: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ Column {
|
|||
AnimatedImage {
|
||||
width: Tokens.sizes.session.button
|
||||
height: Tokens.sizes.session.button
|
||||
sourceSize.width: width
|
||||
sourceSize.width: width * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1)
|
||||
|
||||
playing: visible
|
||||
asynchronous: true
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Caelestia.Config
|
||||
import qs.components
|
||||
|
|
@ -98,7 +99,7 @@ Item {
|
|||
asynchronous: true
|
||||
source: Paths.absolutePath(Config.paths.noNotifsPic)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: clipRect.width * 0.8
|
||||
sourceSize.width: clipRect.width * 0.8 * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1)
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: Colouriser {
|
||||
|
|
|
|||
|
|
@ -87,8 +87,10 @@ StyledRect {
|
|||
Image {
|
||||
source: Qt.resolvedUrl(root.image)
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||
sourceSize: {
|
||||
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||
return Qt.size(size, size);
|
||||
}
|
||||
cache: false
|
||||
asynchronous: true
|
||||
width: TokenConfig.sizes.notifs.image
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue