shift-shell/components/mobileshell/qml/homescreen/HomeScreenWallpaperBlur.qml
Devin Lin 1d3ceb5801 homescreens/halcyon: Add settings page
Add a settings page to halcyon, which allows for toggling whether the
wallpaper is blurred and double tapping on the homescreen to lock the
device. This also does a bit of refactoring for folio and halcyon to
share the same wallpaper blurring item.
2025-06-26 18:57:12 -04:00

40 lines
No EOL
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
}
}
}