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)
|
source: Players.getArtUrl(Players.active)
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: width
|
sourceSize: {
|
||||||
sourceSize.height: height
|
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||||
|
return Qt.size(width * dpr, height * dpr);
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Shapes
|
import QtQuick.Shapes
|
||||||
|
import Quickshell
|
||||||
import Caelestia.Config
|
import Caelestia.Config
|
||||||
import Caelestia.Services
|
import Caelestia.Services
|
||||||
import qs.components
|
import qs.components
|
||||||
|
|
@ -109,8 +110,10 @@ Item {
|
||||||
source: Players.getArtUrl(Players.active)
|
source: Players.getArtUrl(Players.active)
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: width
|
sourceSize: {
|
||||||
sourceSize.height: height
|
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
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
import Caelestia.Config
|
import Caelestia.Config
|
||||||
import qs.components
|
import qs.components
|
||||||
import qs.components.effects
|
import qs.components.effects
|
||||||
|
|
@ -22,8 +23,10 @@ Item {
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: width
|
sourceSize: {
|
||||||
sourceSize.height: height
|
const dpr = (QsWindow.window as QsWindow)?.devicePixelRatio ?? 1;
|
||||||
|
return Qt.size(width * dpr, height * dpr);
|
||||||
|
}
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: OpacityMask {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ ColumnLayout {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: Paths.absolutePath(Config.paths.lockNoNotifsPic)
|
source: Paths.absolutePath(Config.paths.lockNoNotifsPic)
|
||||||
fillMode: Image.PreserveAspectFit
|
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.enabled: true
|
||||||
layer.effect: Colouriser {
|
layer.effect: Colouriser {
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,10 @@ StyledRect {
|
||||||
Image {
|
Image {
|
||||||
source: Qt.resolvedUrl(root.image)
|
source: Qt.resolvedUrl(root.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
sourceSize: {
|
||||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||||
|
return Qt.size(size, size);
|
||||||
|
}
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
width: TokenConfig.sizes.notifs.image
|
width: TokenConfig.sizes.notifs.image
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,10 @@ StyledRect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: Qt.resolvedUrl(root.modelData.image)
|
source: Qt.resolvedUrl(root.modelData.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
sourceSize: {
|
||||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||||
|
return Qt.size(size, size);
|
||||||
|
}
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ Column {
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
width: Tokens.sizes.session.button
|
width: Tokens.sizes.session.button
|
||||||
height: Tokens.sizes.session.button
|
height: Tokens.sizes.session.button
|
||||||
sourceSize.width: width
|
sourceSize.width: width * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1)
|
||||||
|
|
||||||
playing: visible
|
playing: visible
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import Caelestia.Config
|
import Caelestia.Config
|
||||||
import qs.components
|
import qs.components
|
||||||
|
|
@ -98,7 +99,7 @@ Item {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: Paths.absolutePath(Config.paths.noNotifsPic)
|
source: Paths.absolutePath(Config.paths.noNotifsPic)
|
||||||
fillMode: Image.PreserveAspectFit
|
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.enabled: true
|
||||||
layer.effect: Colouriser {
|
layer.effect: Colouriser {
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,10 @@ StyledRect {
|
||||||
Image {
|
Image {
|
||||||
source: Qt.resolvedUrl(root.image)
|
source: Qt.resolvedUrl(root.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: TokenConfig.sizes.notifs.image
|
sourceSize: {
|
||||||
sourceSize.height: TokenConfig.sizes.notifs.image
|
const size = TokenConfig.sizes.notifs.image * ((QsWindow.window as QsWindow)?.devicePixelRatio ?? 1);
|
||||||
|
return Qt.size(size, size);
|
||||||
|
}
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
width: TokenConfig.sizes.notifs.image
|
width: TokenConfig.sizes.notifs.image
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue