1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-24 12:05:21 -04:00
Files
DankMaterialShell/quickshell/Widgets/BackdropBlur.qml
T
purian23 99cc3b8449 feat(wallpaper): preload thumbnails & switch/sort options
- add sorting and clickable page jump
- wrap-around page navigation
2026-06-23 21:39:06 -04:00

51 lines
1.2 KiB
QML

import QtQuick
import QtQuick.Effects
import qs.Common
import qs.Services
// Frosted-glass backdrop: blurs the region of sourceItem directly behind the item
Item {
id: root
property Item sourceItem: null
property real radius: Theme.cornerRadius
property real blurAmount: 1.0
property int blurMax: 96
readonly property bool blurActive: visible && BlurService.enabled
ShaderEffectSource {
id: snapshot
anchors.fill: parent
sourceItem: root.sourceItem
sourceRect: {
if (!root.sourceItem)
return Qt.rect(0, 0, 0, 0);
const p = root.mapToItem(root.sourceItem, 0, 0);
return Qt.rect(p.x, p.y, root.width, root.height);
}
live: root.blurActive
hideSource: false
visible: false
}
MultiEffect {
anchors.fill: parent
source: snapshot
visible: root.blurActive
blurEnabled: root.blurActive
blurMax: root.blurMax
blur: root.blurAmount
maskEnabled: true
maskSource: maskRect
}
Rectangle {
id: maskRect
anchors.fill: parent
radius: root.radius
visible: false
layer.enabled: true
}
}