forked from Shinonome/dots-hyprland
background: add auto vertical parallax option
This commit is contained in:
@@ -51,6 +51,7 @@ Variants {
|
|||||||
property int wallpaperHeight: modelData.height // Some reasonable init value, to be updated
|
property int wallpaperHeight: modelData.height // Some reasonable init value, to be updated
|
||||||
property real movableXSpace: ((wallpaperWidth / wallpaperToScreenRatio * effectiveWallpaperScale) - screen.width) / 2
|
property real movableXSpace: ((wallpaperWidth / wallpaperToScreenRatio * effectiveWallpaperScale) - screen.width) / 2
|
||||||
property real movableYSpace: ((wallpaperHeight / wallpaperToScreenRatio * effectiveWallpaperScale) - screen.height) / 2
|
property real movableYSpace: ((wallpaperHeight / wallpaperToScreenRatio * effectiveWallpaperScale) - screen.height) / 2
|
||||||
|
readonly property bool verticalParallax: (Config.options.background.parallax.autoVertical && wallpaperHeight > wallpaperWidth) || Config.options.background.parallax.vertical
|
||||||
// Position
|
// Position
|
||||||
property real clockX: (modelData.width / 2) + ((Math.random() < 0.5 ? -1 : 1) * modelData.width)
|
property real clockX: (modelData.width / 2) + ((Math.random() < 0.5 ? -1 : 1) * modelData.width)
|
||||||
property real clockY: (modelData.height / 2) + ((Math.random() < 0.5 ? -1 : 1) * modelData.height)
|
property real clockY: (modelData.height / 2) + ((Math.random() < 0.5 ? -1 : 1) * modelData.height)
|
||||||
@@ -173,7 +174,7 @@ Variants {
|
|||||||
property int range: upper - lower;
|
property int range: upper - lower;
|
||||||
property real valueX: {
|
property real valueX: {
|
||||||
let result = 0.5;
|
let result = 0.5;
|
||||||
if (Config.options.background.parallax.enableWorkspace && !Config.options.background.parallax.vertical) {
|
if (Config.options.background.parallax.enableWorkspace && !bgRoot.verticalParallax) {
|
||||||
result = ((bgRoot.monitor.activeWorkspace?.id - lower) / range);
|
result = ((bgRoot.monitor.activeWorkspace?.id - lower) / range);
|
||||||
}
|
}
|
||||||
if (Config.options.background.parallax.enableSidebar) {
|
if (Config.options.background.parallax.enableSidebar) {
|
||||||
@@ -183,7 +184,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
property real valueY: {
|
property real valueY: {
|
||||||
let result = 0.5;
|
let result = 0.5;
|
||||||
if (Config.options.background.parallax.enableWorkspace && Config.options.background.parallax.vertical) {
|
if (Config.options.background.parallax.enableWorkspace && bgRoot.verticalParallax) {
|
||||||
result = ((bgRoot.monitor.activeWorkspace?.id - lower) / range);
|
result = ((bgRoot.monitor.activeWorkspace?.id - lower) / range);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ Singleton {
|
|||||||
property string thumbnailPath: ""
|
property string thumbnailPath: ""
|
||||||
property JsonObject parallax: JsonObject {
|
property JsonObject parallax: JsonObject {
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
|
property bool autoVertical: false
|
||||||
property bool enableWorkspace: true
|
property bool enableWorkspace: true
|
||||||
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
|
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
|
||||||
property bool enableSidebar: true
|
property bool enableSidebar: true
|
||||||
|
|||||||
Reference in New Issue
Block a user