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';
if (!wallpaperUrl) { const lightWallpaperFolder = 'wallpapers/Next/contents/images/';
return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png'); const darkWallpaperFolder = 'wallpapers/Next/contents/images_dark/';
}
return wallpaperUrl; const wallpaperUrl = StandardPaths.locate(
} else { StandardPaths.GenericDataLocation,
return StandardPaths.locate(StandardPaths.GenericDataLocation, 'wallpapers/Next/contents/images/720x1440.png'); (Prepare.PrepareUtil.usingDarkTheme ? darkWallpaperFolder : lightWallpaperFolder) + imgFile
);
if (!wallpaperUrl) {
return StandardPaths.locate(StandardPaths.GenericDataLocation, lightWallpaperFolder + imgFile);
} }
return wallpaperUrl;
} }
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop