mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Background: avoid resizing wallpapers if one of the axis fits perfectly on screen.
This commit is contained in:
@@ -121,6 +121,7 @@ Variants {
|
||||
visible: false
|
||||
cache: false
|
||||
asynchronous: true
|
||||
sourceSize: undefined
|
||||
|
||||
onStatusChanged: {
|
||||
if (status === Image.Error) {
|
||||
@@ -137,6 +138,11 @@ Variants {
|
||||
}
|
||||
|
||||
function calculateSourceSize() {
|
||||
if (implicitWidth === modelData.width || implicitHeight === modelData.height) {
|
||||
// Do not resize if one of the dimensions fits perfectly on the screen
|
||||
return
|
||||
}
|
||||
|
||||
if (implicitWidth > 0 && implicitHeight > 0) {
|
||||
const imageAspectRatio = implicitWidth / implicitHeight
|
||||
if (modelData.width >= modelData.height) {
|
||||
@@ -161,6 +167,7 @@ Variants {
|
||||
visible: false
|
||||
cache: false
|
||||
asynchronous: true
|
||||
sourceSize: undefined
|
||||
|
||||
onStatusChanged: {
|
||||
if (status === Image.Error) {
|
||||
@@ -177,6 +184,11 @@ Variants {
|
||||
}
|
||||
|
||||
function calculateSourceSize() {
|
||||
if (implicitWidth === modelData.width || implicitHeight === modelData.height) {
|
||||
// Do not resize if one of the dimensions fits perfectly on the screen
|
||||
return
|
||||
}
|
||||
|
||||
if (implicitWidth > 0 && implicitHeight > 0) {
|
||||
const imageAspectRatio = implicitWidth / implicitHeight
|
||||
if (modelData.width >= modelData.height) {
|
||||
|
||||
Reference in New Issue
Block a user