From db1e2ea3bf7dd1f5ac1960ca4c9dc17757649460 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 26 Jul 2025 23:11:28 +1000 Subject: dcontent: impl bt settings --- modules/detachedcontent/bluetooth/DeviceList.qml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'modules/detachedcontent/bluetooth/DeviceList.qml') diff --git a/modules/detachedcontent/bluetooth/DeviceList.qml b/modules/detachedcontent/bluetooth/DeviceList.qml index 8f77cfd..91fca23 100644 --- a/modules/detachedcontent/bluetooth/DeviceList.qml +++ b/modules/detachedcontent/bluetooth/DeviceList.qml @@ -1,3 +1,6 @@ +pragma ComponentBehavior: Bound + +import ".." import qs.widgets import qs.services import qs.config @@ -11,6 +14,8 @@ import QtQuick.Controls ColumnLayout { id: root + required property Session session + anchors.fill: parent spacing: Appearance.spacing.small @@ -32,7 +37,11 @@ ColumnLayout { radius: Appearance.rounding.normal color: Colours.palette.m3surfaceContainer - StateLayer {} + StateLayer { + function onClicked(): void { + root.session.bt.active = null; + } + } StyledText { id: settingsText @@ -65,7 +74,7 @@ ColumnLayout { ScrollBar.vertical: StyledScrollBar {} - delegate: StyledRect { + delegate: Item { id: device required property BluetoothDevice modelData @@ -79,7 +88,10 @@ ColumnLayout { StateLayer { id: stateLayer + radius: Appearance.rounding.small + function onClicked(): void { + root.session.bt.active = device.modelData; } } @@ -88,8 +100,6 @@ ColumnLayout { anchors.fill: parent anchors.margins: Appearance.padding.normal - anchors.leftMargin: Appearance.padding.large - anchors.rightMargin: Appearance.padding.large spacing: Appearance.spacing.normal @@ -97,7 +107,7 @@ ColumnLayout { implicitWidth: implicitHeight implicitHeight: icon.implicitHeight + Appearance.padding.normal * 2 - radius: Appearance.rounding.full + radius: Appearance.rounding.normal color: device.connected ? Colours.palette.m3primaryContainer : device.modelData.bonded ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainerHigh StyledRect { -- cgit v1.2.3-freya