From 0b23a298089dc30ce97c8489481d79d93b70877e Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Mon, 30 May 2022 08:09:25 +0800 Subject: [PATCH] wallpapers/image: use the aspect ratio of the screen it will change the wallpaper for Th aspect ratio of thumbnails should follow the Plasmoid size, not the screen size. BUG: 452308 FIXED-IN: 5.24.6 (cherry picked from 19084358c7c4e29fc7a99183ca0af1b947664a72) --- .../image/imagepackage/contents/ui/config.qml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/wallpapers/image/imagepackage/contents/ui/config.qml b/wallpapers/image/imagepackage/contents/ui/config.qml index 6f41e420f..4edf8877a 100644 --- a/wallpapers/image/imagepackage/contents/ui/config.qml +++ b/wallpapers/image/imagepackage/contents/ui/config.qml @@ -430,8 +430,26 @@ ColumnLayout { } //set the size of the cell, depending on Screen resolution to respect the aspect ratio - view.implicitCellWidth: Screen.width / 10 + Kirigami.Units.smallSpacing * 2 - view.implicitCellHeight: Screen.height / 10 + Kirigami.Units.smallSpacing * 2 + Kirigami.Units.gridUnit * 3 + view.implicitCellWidth: { + let screenWidth = 0; + if (typeof plasmoid !== "undefined") { + screenWidth = plasmoid.width; + } else { + screenWidth = Screen.width; + } + + return screenWidth / 10 + Kirigami.Units.smallSpacing * 2; + } + view.implicitCellHeight: { + let screenHeight = 0; + if (typeof plasmoid !== "undefined") { + screenHeight = plasmoid.height; + } else { + screenHeight = Screen.height; + } + + return screenHeight / 10 + Kirigami.Units.smallSpacing * 2 + Kirigami.Units.gridUnit * 3; + } view.delegate: WallpaperDelegate { color: cfg_Color