mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
initialstart: Ensure background image accounts for widescreen, and raise resolution
This commit is contained in:
parent
94d10f35ef
commit
e3ecb1dad4
1 changed files with 16 additions and 8 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue