nova-shell/modules/OverviewBackdrop.qml

63 lines
1.6 KiB
QML

import QtQuick
import Quickshell
import Quickshell.Wayland
import "." as M
PanelWindow {
id: root
required property var screen
color: "transparent"
WlrLayershell.layer: WlrLayer.Background
WlrLayershell.exclusiveZone: -1
WlrLayershell.namespace: "nova-overview-backdrop"
mask: Region {}
anchors.top: true
anchors.left: true
anchors.right: true
anchors.bottom: true
Rectangle {
anchors.fill: parent
color: M.Theme.base01
}
ShaderEffect {
id: fx
anchors.fill: parent
fragmentShader: Quickshell.shellPath("modules/hex_wave.frag.qsb")
property real uSize: 50.0
property real uWavePhase: -200
property vector4d uResolution: Qt.vector4d(width, height, 0, 0)
property color uC0: M.Theme.base0C
property color uC1: M.Theme.base0E
property color uC2: M.Theme.base09
Connections {
target: M.NiriIpc
function onOverviewOpenChanged() {
if (!M.NiriIpc.overviewOpen)
fx.uWavePhase = -200;
}
}
// Wave animation: 6s sweep + 8s pause, only while overview is open
SequentialAnimation on uWavePhase {
loops: Animation.Infinite
running: M.NiriIpc.overviewOpen && !M.Theme.reducedMotion
NumberAnimation {
from: -200
to: fx.width + 200
duration: 6000
easing.type: Easing.InOutSine
}
PauseAnimation {
duration: 8000
}
}
}
}