From e3ecb1dad4ab9ab2e316745d01d01aa4539cfb0b Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Wed, 31 Jan 2024 10:39:35 -0500 Subject: [PATCH] initialstart: Ensure background image accounts for widescreen, and raise resolution --- initialstart/qml/LandingComponent.qml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/initialstart/qml/LandingComponent.qml b/initialstart/qml/LandingComponent.qml index 45e5cb81..04afd519 100644 --- a/initialstart/qml/LandingComponent.qml +++ b/initialstart/qml/LandingComponent.qml @@ -40,16 +40,24 @@ Item { Image { id: backgroundImage anchors.fill: parent + + readonly property bool isLandscape: width >= height + source: { - if (Prepare.PrepareUtil.usingDarkTheme) { - const wallpaperUrl = StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images_dark/720x1440.png'); - if (!wallpaperUrl) { - return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png'); - } - return wallpaperUrl; - } else { - return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png'); + // default wallpaper background + const imgFile = isLandscape ? '2560x1440.png' : '1080x1920.png'; + const lightWallpaperFolder = 'wallpapers/Next/contents/images/'; + const darkWallpaperFolder = 'wallpapers/Next/contents/images_dark/'; + + const wallpaperUrl = StandardPaths.locate( + StandardPaths.GenericDataLocation, + (Prepare.PrepareUtil.usingDarkTheme ? darkWallpaperFolder : lightWallpaperFolder) + imgFile + ); + + if (!wallpaperUrl) { + return StandardPaths.locate(StandardPaths.GenericDataLocation, lightWallpaperFolder + imgFile); } + return wallpaperUrl; } fillMode: Image.PreserveAspectCrop