homescreens/folio: Use MultiEffect for blur and blur behind task switcher

This commit is contained in:
Devin Lin 2023-11-15 20:24:44 -08:00
parent c8aef0d208
commit 871bee83c0
2 changed files with 14 additions and 7 deletions

View file

@ -59,6 +59,11 @@ Item {
property real leftMargin
property real rightMargin
/**
* The opacity value that the homescreen content gets.
*/
readonly property real contentOpacity: itemContainer.opacity
function evaluateMargins() {
topMargin = plasmoidItem.availableScreenRect.y
bottomMargin = root.height - (plasmoidItem.availableScreenRect.y + plasmoidItem.availableScreenRect.height)

View file

@ -1,9 +1,10 @@
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Layouts 1.1
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Effects
import org.kde.kirigami 2.20 as Kirigami
@ -15,8 +16,6 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState
import org.kde.private.mobile.homescreen.folio 1.0 as Folio
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
import Qt5Compat.GraphicalEffects
ContainmentItem {
id: root
@ -31,11 +30,14 @@ ContainmentItem {
}
// wallpaper blur
FastBlur {
radius: 50
MultiEffect {
blurEnabled: true
blur: 1.0
blurMax: 50
source: Plasmoid.wallpaperGraphicsObject
anchors.fill: parent
opacity: Math.max(
1 - homeScreen.contentOpacity,
Folio.HomeScreenState.appDrawerOpenProgress,
Folio.HomeScreenState.searchWidgetOpenProgress,
Folio.HomeScreenState.folderOpenProgress