Kylin/Fluent/qml/Acrylic.qml

34 lines
920 B
QML
Raw Permalink Normal View History

2024-08-31 04:13:21 +08:00
import QtQuick
Item {
id: control
property color tintColor: Qt.rgba(1, 1, 1, 1)
property real tintOpacity: 0.65
property real luminosity: 0.01
property real noiseOpacity: 0.02
property var target
property int blurRadius: 32
property rect targetRect: Qt.rect(control.x, control.y, control.width,control.height)
ShaderEffectSource {
id: effect_source
anchors.fill: parent
visible: false
sourceRect: control.targetRect
sourceItem: control.target
}
Rectangle {
anchors.fill: parent
color: Qt.rgba(1, 1, 1, luminosity)
}
Rectangle {
anchors.fill: parent
color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity)
}
Image {
anchors.fill: parent
source: "qrc:/qt/qml/Fluent/resources/noise.png"
fillMode: Image.Tile
opacity: control.noiseOpacity
}
}