fuck transitions
This commit is contained in:
parent
d4ae7be638
commit
53ee6f4103
@ -40,7 +40,7 @@ Rectangle {
|
||||
required property var modelData
|
||||
width: !modelData.focused ? 20 : 40
|
||||
height: isOnMon ? Settings.config.barHeight - Settings.config.barHeight / 2 : 0
|
||||
color: modelData.focused ? Colors.primary : Colors.surfaceContainerHigh
|
||||
color: modelData.focused ? Colors.primary : Colors.surfaceContainer
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
|
||||
|
||||
@ -1,75 +1,32 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls // <--- Needed for StackView
|
||||
import Quickshell.Wayland
|
||||
import qs.settings
|
||||
|
||||
WlrLayershell {
|
||||
Variants {
|
||||
id: root
|
||||
layer: WlrLayer.Background
|
||||
keyboardFocus: WlrKeyboardFocus.None
|
||||
model: Quickshell.screens
|
||||
delegate: WlrLayershell {
|
||||
id: wpShell
|
||||
aboveWindows: false
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
anchors {
|
||||
left: true
|
||||
top: true
|
||||
bottom: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
layer: WlrLayer.Background
|
||||
|
||||
// We need to accept the screen from Variants
|
||||
required property var modelData
|
||||
|
||||
// 1. The StackView manages the images
|
||||
StackView {
|
||||
id: wallStack
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
// 2. Define what a "Wallpaper" looks like
|
||||
Component {
|
||||
id: wallComponent
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
width: wallStack.width
|
||||
height: wallStack.height
|
||||
asynchronous: true // ⚡ VERY IMPORTANT: Prevents lag while loading!
|
||||
}
|
||||
}
|
||||
|
||||
// 4. THE ANIMATIONS 🎬
|
||||
// When a new wall replaces the old one:
|
||||
|
||||
// New One: Fades In (0 -> 1)
|
||||
replaceEnter: Transition {
|
||||
NumberAnimation {
|
||||
property: "x"
|
||||
from: wallStack.width
|
||||
to: 0
|
||||
duration: 800 // Slower = Smoother
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
|
||||
// Old One: Fades Out (1 -> 0)
|
||||
replaceExit: Transition {
|
||||
NumberAnimation {
|
||||
property: "x"
|
||||
from: 0
|
||||
to: -wallStack.width
|
||||
duration: 800
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 5. The Trigger 🔫
|
||||
// We listen for the singleton to change, then tell the Stack to update
|
||||
Connections {
|
||||
target: Settings
|
||||
|
||||
function onCurrentWallChanged() {
|
||||
wallStack.replace(wallComponent, {
|
||||
"source": Settings.currentWall
|
||||
});
|
||||
source: Settings.config.currentWall
|
||||
}
|
||||
ScreenCorners {}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user