From 9ae78eda45f11f39002edd366b2e07ba8fd00b13 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Thu, 4 Sep 2025 23:48:16 -0400 Subject: [PATCH] Bluetooth: more UI polish --- Modules/BluetoothPanel/BluetoothDevicesList.qml | 10 ++++------ Modules/BluetoothPanel/BluetoothPanel.qml | 13 ++++++------- Services/BluetoothService.qml | 1 - 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Modules/BluetoothPanel/BluetoothDevicesList.qml b/Modules/BluetoothPanel/BluetoothDevicesList.qml index 8780d95..390b709 100644 --- a/Modules/BluetoothPanel/BluetoothDevicesList.qml +++ b/Modules/BluetoothPanel/BluetoothDevicesList.qml @@ -96,7 +96,7 @@ ColumnLayout { // Signal Strength RowLayout { - visible: modelData.signalStrength !== undefined + visible: modelData.signalStrength !== undefined Layout.fillWidth: true spacing: Style.marginXS * scaling @@ -115,8 +115,7 @@ ColumnLayout { } NText { - visible: modelData.signalStrength > 0 && !modelData.pairing - && !modelData.blocked + visible: modelData.signalStrength > 0 && !modelData.pairing && !modelData.blocked text: (modelData.signalStrength !== undefined && modelData.signalStrength > 0) ? modelData.signalStrength + "%" : "" font.pointSize: Style.fontSizeXS * scaling @@ -171,10 +170,9 @@ ColumnLayout { BluetoothService.disconnectDevice(modelData) } else { BluetoothService.connectDeviceWithTrust(modelData) - } + } } - onRightClicked: - { + onRightClicked: { BluetoothService.forgetDevice(modelData) } } diff --git a/Modules/BluetoothPanel/BluetoothPanel.qml b/Modules/BluetoothPanel/BluetoothPanel.qml index 67cce45..8f90831 100644 --- a/Modules/BluetoothPanel/BluetoothPanel.qml +++ b/Modules/BluetoothPanel/BluetoothPanel.qml @@ -97,7 +97,7 @@ NPanel { // Known devices BluetoothDevicesList { label: "Known devices" - tooltipText: "Left click to connect, right click to forget" + tooltipText: "Left click to connect.\nRight click to forget." property var items: { if (!BluetoothService.adapter || !Bluetooth.devices) return [] @@ -124,9 +124,9 @@ NPanel { Layout.fillWidth: true } - // Fallback + // Fallback - No devices, scanning ColumnLayout { - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter spacing: Style.marginM * scaling visible: { if (!BluetoothService.adapter || !BluetoothService.adapter.discovering || !Bluetooth.devices) { @@ -144,11 +144,11 @@ NPanel { RowLayout { Layout.alignment: Qt.AlignHCenter - spacing: Style.marginM * scaling + spacing: Style.marginXS * scaling NIcon { text: "sync" - font.pointSize: Style.fontSizeXLL * 1.5 * scaling + font.pointSize: Style.fontSizeXXL * 1.5 * scaling color: Color.mPrimary RotationAnimation on rotation { @@ -164,12 +164,11 @@ NPanel { text: "Scanning for devices..." font.pointSize: Style.fontSizeL * scaling color: Color.mOnSurface - font.weight: Style.fontWeightMedium } } NText { - text: "Make sure your device is in pairing mode" + text: "Make sure your device is in pairing mode." font.pointSize: Style.fontSizeM * scaling color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter diff --git a/Services/BluetoothService.qml b/Services/BluetoothService.qml index d6de5b5..d5e2d51 100644 --- a/Services/BluetoothService.qml +++ b/Services/BluetoothService.qml @@ -120,7 +120,6 @@ Singleton { return "" } - function getSignalStrength(device) { if (!device || device.signalStrength === undefined || device.signalStrength <= 0) { return "Signal: Unknown"