initialstart: Ensure background image accounts for widescreen, and raise resolution

This commit is contained in:
Devin Lin 2024-01-31 10:39:35 -05:00
parent 94d10f35ef
commit e3ecb1dad4

View file

@ -40,16 +40,24 @@ Item {
Image { Image {
id: backgroundImage id: backgroundImage
anchors.fill: parent anchors.fill: parent
readonly property bool isLandscape: width >= height
source: { source: {
if (Prepare.PrepareUtil.usingDarkTheme) { // default wallpaper background
const wallpaperUrl = StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images_dark/720x1440.png'); 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) { if (!wallpaperUrl) {
return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png'); return StandardPaths.locate(StandardPaths.GenericDataLocation, lightWallpaperFolder + imgFile);
} }
return wallpaperUrl; return wallpaperUrl;
} else {
return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png');
}
} }
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop