// 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. The original drew the floating // panel and its shadow from the theme's panel-background through KSvg; KOutNet // has no Plasma theme to resolve that through, so the panel is drawn here // instead, as a rounded translucent bar in the Kirigami theme's colours, with a // soft shadow cast the same way the mock card casts its own. The launcher slot // and the applets stay the original's. import QtQuick import koutnet.app import QtQuick.Layouts import org.kde.kirigami as Kirigami Item { id: root default property alias children: appletContainer.children // NOTE: Distros overriding our default floating panels should patch this to false readonly property bool floating: true readonly property int floatingMargins: Kirigami.Units.largeSpacing // Floating margins readonly property int panelHeight: 44 // Default panel height height: panelHeight + (floating ? (floatingMargins * 2) : 0) implicitWidth: appletContainer.implicitWidth + (floating ? (floatingMargins * 2) : 0) + appletContainer.anchors.leftMargin + appletContainer.anchors.rightMargin Item { id: panelContainer height: root.panelHeight anchors.fill: root anchors.margins: root.floating ? root.floatingMargins : 0 Rectangle { id: panelBody anchors.fill: panelContainer radius: 7 layer.enabled: GraphicsInfo.api !== GraphicsInfo.Software layer.effect: Kirigami.ShadowedTexture { radius: 8 } color: Qt.rgba(AppPalette.background.r, AppPalette.background.g, AppPalette.background.b, 0.85) border.color: Qt.rgba(AppPalette.text.r, AppPalette.text.g, AppPalette.text.b, 0.12) border.width: 1 } RowLayout { id: appletContainer anchors.fill: panelContainer anchors.leftMargin: Kirigami.Units.largeSpacing anchors.rightMargin: Kirigami.Units.largeSpacing spacing: Kirigami.Units.smallSpacing } } }