Merge branch 'main' into hefty-hype

This commit is contained in:
end-4
2026-04-10 22:12:48 +02:00
13 changed files with 38 additions and 27 deletions
@@ -223,9 +223,9 @@ Singleton {
property JsonObject parallax: JsonObject {
property bool vertical: false
property bool autoVertical: false
property bool enableWorkspace: true
property real workspaceZoom: 1.0 // Relative to wallpaper size
property bool enableSidebar: true
property bool enableWorkspace: false
property real workspaceZoom: 1.07 // Relative to wallpaper size
property bool enableSidebar: false
property real widgetsFactor: 1.2
}
}
@@ -7,7 +7,7 @@ Item {
z: 99
required property Item target
property real fadeSize: Appearance.m3colors.darkmode ? 40 : 20
property color color: ColorUtils.transparentize(Appearance.colors.colShadow, Appearance.m3colors.darkmode ? 0 : 0.7)
property color color: Appearance.colors.colLayer1Base
property bool vertical: true
anchors.fill: target
@@ -48,9 +48,9 @@ Variants {
const sensitiveNetwork = (CF.StringUtils.stringListContainsSubstring(Network.networkName.toLowerCase(), Config.options.workSafety.triggerCondition.networkNameKeywords));
return enabled && sensitiveWallpaper && sensitiveNetwork;
}
readonly property real parallaxRation: 1.1
readonly property real additionalScaleFactor: Config.options.background.parallax.workspaceZoom
property real effectiveWallpaperScale: 1 // Some reasonable init value, to be updated
readonly property real parallaxRation: Config.options.background.parallax.workspaceZoom
property real minSuitableScale: 1 // Some reasonable init, to be updated
property real effectiveWallpaperScale: minSuitableScale * parallaxRation
property int wallpaperWidth: modelData.width // Some reasonable init value, to be updated
property int wallpaperHeight: modelData.height // Some reasonable init value, to be updated
property real scaledWallpaperWidth: wallpaperWidth * effectiveWallpaperScale
@@ -119,8 +119,7 @@ Variants {
// Small picture; scale > 1; will zoom in the picture
// Big picture; scale < 1; will zoom out the picture
// Choose max number so every side will fit
const minSuitableScale = Math.max(screenWidth / width, screenHeight / height);
bgRoot.effectiveWallpaperScale = minSuitableScale * bgRoot.additionalScaleFactor * bgRoot.parallaxRation;
bgRoot.minSuitableScale = Math.max(screenWidth / width, screenHeight / height);
}
}
}
@@ -167,16 +166,16 @@ Variants {
}
x: {
if (bgRoot.screen.width > bgRoot.scaledWallpaperWidth) {
if (bgRoot.screen.width > width) {
// Center the picture
return (bgRoot.screen.width - bgRoot.scaledWallpaperWidth) / 2;
return (bgRoot.screen.width - width) / 2;
}
return - bgRoot.parallaxTotalPixelsX * usedFractionX;
}
y: {
if (bgRoot.screen.height > bgRoot.scaledWallpaperHeight) {
if (bgRoot.screen.height > height) {
// Center the picture
return (bgRoot.screen.height - bgRoot.scaledWallpaperHeight) / 2;
return (bgRoot.screen.height - height) / 2;
}
return - bgRoot.parallaxTotalPixelsY * usedFractionY;
}
@@ -235,10 +234,10 @@ Variants {
height: parent.height
readonly property real parallaxFactor: {
var f = Config.options.background.parallax.widgetsFactor;
return f / Config.options.background.parallax.workspaceZoom;
return f / bgRoot.parallaxRation;
}
readonly property real baseWallpaperOffsetX: (bgRoot.screen.width - bgRoot.scaledWallpaperWidth) / 2
readonly property real baseWallpaperOffsetY: (bgRoot.screen.height - bgRoot.scaledWallpaperHeight) / 2
readonly property real baseWallpaperOffsetX: (bgRoot.screen.width - wallpaper.width) / 2
readonly property real baseWallpaperOffsetY: (bgRoot.screen.height - wallpaper.height) / 2
readonly property real wallpaperTotalOffsetX: wallpaper.x - baseWallpaperOffsetX
readonly property real wallpaperTotalOffsetY: wallpaper.y - baseWallpaperOffsetY
readonly property bool locked: GlobalStates.screenLocked