mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-29 07:44:45 +00:00
40 lines
1 KiB
QML
40 lines
1 KiB
QML
|
|
// SPDX-FileCopyrightText: 2023-2025 Devin Lin <devin@kde.org>
|
||
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||
|
|
|
||
|
|
import QtQuick
|
||
|
|
import QtQuick.Layouts
|
||
|
|
import Qt5Compat.GraphicalEffects
|
||
|
|
|
||
|
|
Loader {
|
||
|
|
id: root
|
||
|
|
property real blurOpacity
|
||
|
|
property Item wallpaperItem
|
||
|
|
|
||
|
|
sourceComponent: Item {
|
||
|
|
id: wallpaper
|
||
|
|
anchors.fill: parent
|
||
|
|
|
||
|
|
// only take samples from wallpaper when we need the blur for performance
|
||
|
|
ShaderEffectSource {
|
||
|
|
id: controlledWallpaperSource
|
||
|
|
anchors.fill: parent
|
||
|
|
|
||
|
|
live: blur.visible
|
||
|
|
hideSource: false
|
||
|
|
visible: false
|
||
|
|
sourceItem: root.wallpaperItem
|
||
|
|
}
|
||
|
|
|
||
|
|
// wallpaper blur
|
||
|
|
// we attempted to use MultiEffect in the past, but it had very poor performance on the PinePhone
|
||
|
|
FastBlur {
|
||
|
|
id: blur
|
||
|
|
radius: 50
|
||
|
|
cached: true
|
||
|
|
source: controlledWallpaperSource
|
||
|
|
anchors.fill: parent
|
||
|
|
visible: opacity > 0
|
||
|
|
opacity: root.blurOpacity
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|