From ded156f58d0a23b3926e9dbbbc5ed2a7d1d4c0c7 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 5 Jun 2025 22:13:27 +1000 Subject: feat: bluetooth popout --- modules/bar/popouts/Bluetooth.qml | 18 ++++++++++++++++++ modules/bar/popouts/Content.qml | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 modules/bar/popouts/Bluetooth.qml (limited to 'modules/bar/popouts') diff --git a/modules/bar/popouts/Bluetooth.qml b/modules/bar/popouts/Bluetooth.qml new file mode 100644 index 0000000..ad7d087 --- /dev/null +++ b/modules/bar/popouts/Bluetooth.qml @@ -0,0 +1,18 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import QtQuick + +Column { + id: root + + spacing: Appearance.spacing.normal + + StyledText { + text: qsTr("Bluetooth %1").arg(Bluetooth.powered ? "enabled" : "disabled") + } + + StyledText { + text: Bluetooth.devices.some(d => d.connected) ? qsTr("Connected to: %1").arg(Bluetooth.devices.filter(d => d.connected).map(d => d.alias).join(", ")) : qsTr("No devices connected") + } +} diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 43f2c8e..a8051f8 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -10,8 +10,8 @@ Item { anchors.centerIn: parent - implicitWidth: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitWidth + Appearance.padding.large * 2 : 0 - implicitHeight: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitHeight + Appearance.padding.large * 2 : 0 + implicitWidth: Popouts.hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitWidth ?? 0) + Appearance.padding.large * 2 : 0 + implicitHeight: Popouts.hasCurrent ? (content.children.find(c => c.shouldBeActive)?.implicitHeight ?? 0) + Appearance.padding.large * 2 : 0 Item { id: content @@ -31,6 +31,11 @@ Item { source: "Network.qml" } + Popout { + name: "bluetooth" + source: "Bluetooth.qml" + } + Popout { name: "battery" source: "Battery.qml" -- cgit v1.2.3-freya