forked from Shinonome/dots-hyprland
background: add parallax for sidebars
This commit is contained in:
@@ -145,7 +145,9 @@ Scope {
|
|||||||
const lower = Math.floor(bgRoot.firstWorkspaceId / chunkSize) * chunkSize;
|
const lower = Math.floor(bgRoot.firstWorkspaceId / chunkSize) * chunkSize;
|
||||||
const upper = Math.ceil(bgRoot.lastWorkspaceId / chunkSize) * chunkSize;
|
const upper = Math.ceil(bgRoot.lastWorkspaceId / chunkSize) * chunkSize;
|
||||||
const range = upper - lower;
|
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))
|
property real effectiveValue: Math.max(0, Math.min(1, value))
|
||||||
x: -(bgRoot.movableXSpace) - (effectiveValue - 0.5) * 2 * bgRoot.movableXSpace
|
x: -(bgRoot.movableXSpace) - (effectiveValue - 0.5) * 2 * bgRoot.movableXSpace
|
||||||
|
|||||||
@@ -100,8 +100,9 @@ Singleton {
|
|||||||
property real clockY: -500
|
property real clockY: -500
|
||||||
property string wallpaperPath: Quickshell.configPath("assets/images/default_wallpaper.png")
|
property string wallpaperPath: Quickshell.configPath("assets/images/default_wallpaper.png")
|
||||||
property JsonObject parallax: JsonObject {
|
property JsonObject parallax: JsonObject {
|
||||||
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
|
|
||||||
property bool enableWorkspace: true
|
property bool enableWorkspace: true
|
||||||
|
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
|
||||||
|
property bool enableSidebar: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user