From be6b19ad21f13404fd70d2be6bf3ac16d786f3a8 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:41:56 +1000 Subject: dcontent: add bt pane --- modules/detachedcontent/Panes.qml | 102 +++++++++++--------------------------- 1 file changed, 30 insertions(+), 72 deletions(-) (limited to 'modules/detachedcontent/Panes.qml') diff --git a/modules/detachedcontent/Panes.qml b/modules/detachedcontent/Panes.qml index b0c8440..b9f53ae9 100644 --- a/modules/detachedcontent/Panes.qml +++ b/modules/detachedcontent/Panes.qml @@ -1,12 +1,12 @@ pragma ComponentBehavior: Bound +import "bluetooth" import qs.widgets import qs.services import qs.config import Quickshell.Widgets import QtQuick import QtQuick.Layouts -import QtQuick.Effects ClippingRectangle { id: root @@ -24,23 +24,21 @@ ClippingRectangle { y: -root.session.activeIndex * root.height Pane { - StyledText { - anchors.centerIn: parent - text: qsTr("Work in progress") - color: Colours.palette.m3outline - font.pointSize: Appearance.font.size.extraLarge - font.weight: 500 + index: 0 + sourceComponent: Item { + StyledText { + anchors.centerIn: parent + text: qsTr("Work in progress") + color: Colours.palette.m3outline + font.pointSize: Appearance.font.size.extraLarge + font.weight: 500 + } } } Pane { - StyledText { - anchors.centerIn: parent - text: qsTr("Work in progress") - color: Colours.palette.m3outline - font.pointSize: Appearance.font.size.extraLarge - font.weight: 500 - } + index: 1 + sourceComponent: BtPane {} } Behavior on y { @@ -52,71 +50,31 @@ ClippingRectangle { } } - StyledRect { - anchors.fill: parent - color: Colours.palette.m3surfaceContainer - - layer.enabled: true - layer.effect: MultiEffect { - maskSource: mask - maskEnabled: true - maskInverted: true - maskThresholdMin: 0.5 - maskSpreadAtMin: 1 - } + InnerBorder { + leftThickness: 0 } - Item { - id: mask - - anchors.fill: parent - layer.enabled: true - visible: false - - Rectangle { - anchors.fill: parent - anchors.margins: Appearance.padding.normal - anchors.leftMargin: 0 - radius: Appearance.rounding.small - } - } - - component Pane: Loader { + component Pane: Item { id: pane - default property Item child - - asynchronous: true - active: { - const ly = -layout.y; - const ty = layout.children.indexOf(this) * root.height; - return ly + root.height > ty && ly < ty + root.height; - } + required property int index + property alias sourceComponent: loader.sourceComponent - sourceComponent: Item { - implicitWidth: root.width - implicitHeight: root.height + implicitWidth: root.width + implicitHeight: root.height - Item { - anchors.fill: parent - anchors.margins: Appearance.padding.normal - anchors.leftMargin: 0 + Loader { + id: loader - children: [pane.child] - } - - StyledRect { - anchors.fill: parent - color: Colours.palette.m3surfaceContainer - - layer.enabled: true - layer.effect: MultiEffect { - maskSource: mask - maskEnabled: true - maskInverted: true - maskThresholdMin: 0.5 - maskSpreadAtMin: 1 - } + anchors.fill: parent + asynchronous: true + active: { + if (root.session.activeIndex === pane.index) + return true; + + const ly = -layout.y; + const ty = pane.index * root.height; + return ly + root.height > ty && ly < ty + root.height; } } } -- cgit v1.2.3-freya