Scaling: many improvements and fixes

- radius are not pixels, they should not be scaled
- use "screen" instead of "Screen" which helps a lot in some places
This commit is contained in:
quadbyte 2025-08-07 23:18:05 -04:00
parent eda65a9948
commit d3be5b760b
43 changed files with 532 additions and 538 deletions

View file

@ -7,20 +7,20 @@ import qs.Settings
Rectangle {
id: root
width: 64 * Theme.scale(Screen)
height: 32 * Theme.scale(Screen)
radius: 16 * Theme.scale(Screen)
width: 64 * Theme.scale(screen)
height: 32 * Theme.scale(screen)
radius: 16
color: Theme.surfaceVariant
border.color: Theme.outline
border.width: 1 * Theme.scale(Screen)
border.width: 1 * Theme.scale(screen)
property bool useFahrenheit: Settings.settings.useFahrenheit
Rectangle {
id: slider
width: parent.width / 2 - 4 * Theme.scale(Screen)
height: parent.height - 4 * Theme.scale(Screen)
radius: 14 * Theme.scale(Screen)
width: parent.width / 2 - 4 * Theme.scale(screen)
height: parent.height - 4 * Theme.scale(screen)
radius: 14
color: Theme.accentPrimary
x: 2 + (useFahrenheit ? parent.width / 2 : 0)
y: 2
@ -46,7 +46,7 @@ Rectangle {
Text {
anchors.centerIn: parent
text: "°C"
font.pixelSize: 13 * Theme.scale(Screen)
font.pixelSize: 13 * Theme.scale(screen)
font.bold: !useFahrenheit
color: !useFahrenheit ? Theme.onAccent : Theme.textPrimary
@ -74,7 +74,7 @@ Rectangle {
Text {
anchors.centerIn: parent
text: "°F"
font.pixelSize: 13 * Theme.scale(Screen)
font.pixelSize: 13 * Theme.scale(screen)
font.bold: useFahrenheit
color: useFahrenheit ? Theme.onAccent : Theme.textPrimary

View file

@ -74,7 +74,7 @@ Rectangle {
id: wallpaperGrid
anchors.fill: parent
cellWidth: Math.max(120 * Theme.scale(Screen), (parent.width / 3) - 12 * Theme.scale(Screen))
cellWidth: Math.max(120 * Theme.scale(screen), (parent.width / 3) - 12 * Theme.scale(screen))
cellHeight: cellWidth * 0.6
model: WallpaperManager.wallpaperList
cacheBuffer: 64
@ -84,8 +84,8 @@ Rectangle {
bottomMargin: 8
delegate: Item {
width: wallpaperGrid.cellWidth - 8 * Theme.scale(Screen)
height: wallpaperGrid.cellHeight - 8 * Theme.scale(Screen)
width: wallpaperGrid.cellWidth - 8 * Theme.scale(screen)
height: wallpaperGrid.cellHeight - 8 * Theme.scale(screen)
Rectangle {
id: wallpaperItem
@ -93,9 +93,9 @@ Rectangle {
anchors.fill: parent
anchors.margins: 3
color: Theme.surface
radius: 12 * Theme.scale(Screen)
radius: 12
border.color: Settings.settings.currentWallpaper === modelData ? Theme.accentPrimary : Theme.outline
border.width: 2 * Theme.scale(Screen)
border.width: 2 * Theme.scale(screen)
Image {
id: wallpaperImage
@ -108,8 +108,8 @@ Rectangle {
cache: true
smooth: true
mipmap: true
sourceSize.width: Math.min(width, 480 * Theme.scale(Screen))
sourceSize.height: Math.min(height, 270 * Theme.scale(Screen))
sourceSize.width: Math.min(width, 480 * Theme.scale(screen))
sourceSize.height: Math.min(height, 270 * Theme.scale(screen))
opacity: (wallpaperImage.status == Image.Ready) ? 1 : 0
// Apply circular mask for rounded corners
layer.enabled: true
@ -139,7 +139,7 @@ Rectangle {
Rectangle {
width: wallpaperImage.width
height: wallpaperImage.height
radius: 12 * Theme.scale(Screen)
radius: 12
}
}