wallpaper: renamed Swipe => Wipe
This commit is contained in:
parent
f5b4984295
commit
5ab76c98e5
4 changed files with 30 additions and 30 deletions
|
|
@ -22,9 +22,9 @@ Variants {
|
|||
property bool transitioning: false
|
||||
property real transitionProgress: 0.0
|
||||
|
||||
// Swipe direction: 0=left, 1=right, 2=up, 3=down
|
||||
property real swipeDirection: 0
|
||||
property real swipeSmoothness: 0.05
|
||||
// Wipe direction: 0=left, 1=right, 2=up, 3=down
|
||||
property real wipeDirection: 0
|
||||
property real wipeSmoothness: 0.05
|
||||
|
||||
// External state management
|
||||
property string servicedWallpaper: WallpaperService.getWallpaper(modelData.name)
|
||||
|
|
@ -42,20 +42,20 @@ Variants {
|
|||
case "none":
|
||||
setWallpaperImmediate(servicedWallpaper)
|
||||
break
|
||||
case "swipe_left":
|
||||
swipeDirection = 0
|
||||
case "wipe_left":
|
||||
wipeDirection = 0
|
||||
setWallpaperWithTransition(servicedWallpaper)
|
||||
break
|
||||
case "swipe_right":
|
||||
swipeDirection = 1
|
||||
case "wipe_right":
|
||||
wipeDirection = 1
|
||||
setWallpaperWithTransition(servicedWallpaper)
|
||||
break
|
||||
case "swipe_up":
|
||||
swipeDirection = 2
|
||||
case "wipe_up":
|
||||
wipeDirection = 2
|
||||
setWallpaperWithTransition(servicedWallpaper)
|
||||
break
|
||||
case "swipe_down":
|
||||
swipeDirection = 3
|
||||
case "wipe_down":
|
||||
wipeDirection = 3
|
||||
setWallpaperWithTransition(servicedWallpaper)
|
||||
break
|
||||
default:
|
||||
|
|
@ -112,18 +112,18 @@ Variants {
|
|||
fragmentShader: Qt.resolvedUrl("../../Shaders/qsb/wp_fade.frag.qsb")
|
||||
}
|
||||
|
||||
// Swipe transition shader
|
||||
// Wipe transition shader
|
||||
ShaderEffect {
|
||||
id: swipeShader
|
||||
id: wipeShader
|
||||
anchors.fill: parent
|
||||
visible: Settings.data.wallpaper.transitionType.startsWith('swipe_')
|
||||
visible: Settings.data.wallpaper.transitionType.startsWith('wipe_')
|
||||
|
||||
property variant source1: currentWallpaper
|
||||
property variant source2: nextWallpaper
|
||||
property real progress: transitionProgress
|
||||
property real direction: swipeDirection
|
||||
property real smoothness: swipeSmoothness
|
||||
fragmentShader: Qt.resolvedUrl("../../Shaders/qsb/wp_swipe.frag.qsb")
|
||||
property real direction: wipeDirection
|
||||
property real smoothness: wipeSmoothness
|
||||
fragmentShader: Qt.resolvedUrl("../../Shaders/qsb/wp_wipe.frag.qsb")
|
||||
}
|
||||
|
||||
// Animation for the transition progress
|
||||
|
|
@ -136,7 +136,7 @@ Variants {
|
|||
duration: Settings.data.wallpaper.transitionDuration ?? 1000
|
||||
easing.type: {
|
||||
const transitionType = Settings.data.wallpaper.transitionType ?? 'fade'
|
||||
if (transitionType.startsWith('swipe_')) {
|
||||
if (transitionType.startsWith('wipe_')) {
|
||||
return Easing.InOutCubic
|
||||
}
|
||||
return Easing.InOutCubic
|
||||
|
|
|
|||
|
|
@ -24,20 +24,20 @@ Singleton {
|
|||
name: "Fade"
|
||||
}
|
||||
ListElement {
|
||||
key: "swipe_left"
|
||||
name: "Swipe Left"
|
||||
key: "wipe_left"
|
||||
name: "Wipe Left"
|
||||
}
|
||||
ListElement {
|
||||
key: "swipe_right"
|
||||
name: "Swipe Right"
|
||||
key: "wipe_right"
|
||||
name: "Wipe Right"
|
||||
}
|
||||
ListElement {
|
||||
key: "swipe_up"
|
||||
name: "Swipe Up"
|
||||
key: "wipe_up"
|
||||
name: "Wipe Up"
|
||||
}
|
||||
ListElement {
|
||||
key: "swipe_down"
|
||||
name: "Swipe Down"
|
||||
key: "wipe_down"
|
||||
name: "Wipe Down"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,25 +29,25 @@ void main() {
|
|||
// Calculate edge position based on direction
|
||||
// As progress goes from 0 to 1, we reveal source2 (new wallpaper)
|
||||
if (ubuf.direction < 0.5) {
|
||||
// Swipe from right to left (new image enters from right)
|
||||
// Wipe from right to left (new image enters from right)
|
||||
edge = 1.0 - extendedProgress;
|
||||
factor = smoothstep(edge - ubuf.smoothness, edge + ubuf.smoothness, uv.x);
|
||||
fragColor = mix(color1, color2, factor);
|
||||
}
|
||||
else if (ubuf.direction < 1.5) {
|
||||
// Swipe from left to right (new image enters from left)
|
||||
// Wipe from left to right (new image enters from left)
|
||||
edge = extendedProgress;
|
||||
factor = smoothstep(edge - ubuf.smoothness, edge + ubuf.smoothness, uv.x);
|
||||
fragColor = mix(color2, color1, factor);
|
||||
}
|
||||
else if (ubuf.direction < 2.5) {
|
||||
// Swipe from bottom to top (new image enters from bottom)
|
||||
// Wipe from bottom to top (new image enters from bottom)
|
||||
edge = 1.0 - extendedProgress;
|
||||
factor = smoothstep(edge - ubuf.smoothness, edge + ubuf.smoothness, uv.y);
|
||||
fragColor = mix(color1, color2, factor);
|
||||
}
|
||||
else {
|
||||
// Swipe from top to bottom (new image enters from top)
|
||||
// Wipe from top to bottom (new image enters from top)
|
||||
edge = extendedProgress;
|
||||
factor = smoothstep(edge - ubuf.smoothness, edge + ubuf.smoothness, uv.y);
|
||||
fragColor = mix(color2, color1, factor);
|
||||
Loading…
Add table
Add a link
Reference in a new issue