// SPDX-FileCopyrightText: 2024 Oliver Beard // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL // // Taken from plasma-welcome's private mocks, with its Plasma theme colours and // its install-prefix wallpaper dropped: KOutNet draws no plasma desktop, so the // card is left on the Kirigami theme and on a plain background when the // wallpaper is not installed. import QtQuick import koutnet.app import QtQuick.Effects import org.kde.kirigami as Kirigami Kirigami.AbstractCard { id: root default property alias children: container.children property int backgroundAlignment: Qt.AlignRight | Qt.AlignBottom property double backgroundScale: 1 property int blurRadius: 32 readonly property string wallpaper: "file:///usr/share/wallpapers/Next/contents/images/5120x2880.png" readonly property int desktopWidth: 1024 * backgroundScale readonly property int desktopHeight: 576 * backgroundScale Item { id: container anchors.fill: parent anchors.margins: root.background.borderWidth layer.enabled: GraphicsInfo.api !== GraphicsInfo.Software layer.effect: Kirigami.ShadowedTexture { radius: Kirigami.Units.cornerRadius - root.background.borderWidth } clip: true Rectangle { anchors.fill: parent color: AppPalette.background } Image { id: wallpaperImage anchors.left: (root.backgroundAlignment & Qt.AlignLeft) ? parent.left : undefined anchors.right: (root.backgroundAlignment & Qt.AlignRight) ? parent.right : undefined anchors.horizontalCenter: (root.backgroundAlignment & Qt.AlignHCenter) ? parent.horizontalCenter : undefined anchors.top: (root.backgroundAlignment & Qt.AlignTop) ? parent.top : undefined anchors.bottom: (root.backgroundAlignment & Qt.AlignBottom) ? parent.bottom : undefined anchors.verticalCenter: (root.backgroundAlignment & Qt.AlignVCenter) ? parent.verticalCenter : undefined layer.enabled: GraphicsInfo.api !== GraphicsInfo.Software layer.effect: MultiEffect { autoPaddingEnabled: false blurEnabled: blurMax > 0 blur: 1.0 blurMax: root.blurRadius * root.backgroundScale } width: Math.max(root.width, root.desktopWidth) height: Math.max(root.height, root.desktopHeight) fillMode: Image.PreserveAspectCrop source: root.wallpaper } } }