needs some more work
This commit is contained in:
parent
8845996c8c
commit
41ad28610a
4 changed files with 146 additions and 81 deletions
85
GlassSurface.qml
Normal file
85
GlassSurface.qml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
ClippingRectangle {
|
||||
id: root
|
||||
color: "transparent"
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(1, 1, 1, 0.1)
|
||||
|
||||
property var source
|
||||
property real time: 0.5
|
||||
property real strength: 0.3
|
||||
property real speed: 0.25
|
||||
property real scale: 3.0
|
||||
property real edgeReflectionStrength: 0.2
|
||||
property real edgeReflectionWidth: 0
|
||||
|
||||
// Blur
|
||||
ShaderEffectSource {
|
||||
id: blurredBackground
|
||||
anchors.fill: parent
|
||||
sourceItem: root.source
|
||||
sourceRect: Qt.rect(root.x, root.y, root.width, root.height)
|
||||
hideSource: false
|
||||
live: true
|
||||
}
|
||||
|
||||
FastBlur {
|
||||
id: backgroundBlur
|
||||
anchors.fill: parent
|
||||
source: blurredBackground
|
||||
radius: 16
|
||||
transparentBorder: true
|
||||
}
|
||||
|
||||
// Liquid glass shader warp
|
||||
ShaderEffect {
|
||||
anchors.fill: parent
|
||||
fragmentShader: "root:shaders/liquid-glass.frag.qsb"
|
||||
|
||||
property real time: root.time
|
||||
property real flowSpeed: root.speed
|
||||
property real warpStrength: root.strength
|
||||
property real scale: root.scale
|
||||
property real edgeReflectionStrength: root.edgeReflectionStrength
|
||||
property real edgeReflectionWidth: root.edgeReflectionWidth
|
||||
|
||||
property variant source: ShaderEffectSource {
|
||||
sourceItem: backgroundBlur
|
||||
hideSource: false
|
||||
live: true
|
||||
}
|
||||
}
|
||||
|
||||
// Subtle glass overlay
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 1
|
||||
height: parent.height * 0.3
|
||||
radius: parent.radius - 1
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0.0
|
||||
color: Qt.rgba(1, 1, 1, 0.08)
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: Qt.rgba(1, 1, 1, 0.0)
|
||||
}
|
||||
GradientStop {
|
||||
position: 1.0
|
||||
color: Qt.rgba(1, 1, 1, 0.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue