background: add parallax for sidebars

This commit is contained in:
end-4
2025-07-16 10:38:21 +07:00
parent d176d38552
commit 19aa66568f
2 changed files with 5 additions and 2 deletions
@@ -145,7 +145,9 @@ Scope {
const lower = Math.floor(bgRoot.firstWorkspaceId / chunkSize) * chunkSize;
const upper = Math.ceil(bgRoot.lastWorkspaceId / chunkSize) * chunkSize;
const range = upper - lower;
return (bgRoot.monitor.activeWorkspace.id - lower) / range;
return (bgRoot.monitor.activeWorkspace.id - lower) / range
+ (0.15 * GlobalStates.sidebarRightOpen * Config.options.background.parallax.enableSidebar)
- (0.15 * GlobalStates.sidebarLeftOpen * Config.options.background.parallax.enableSidebar)
}
property real effectiveValue: Math.max(0, Math.min(1, value))
x: -(bgRoot.movableXSpace) - (effectiveValue - 0.5) * 2 * bgRoot.movableXSpace