Bluetooth: more UI polish

This commit is contained in:
LemmyCook 2025-09-04 23:48:16 -04:00
parent cc8a24f445
commit 9ae78eda45
3 changed files with 10 additions and 14 deletions

View file

@ -96,7 +96,7 @@ ColumnLayout {
// Signal Strength // Signal Strength
RowLayout { RowLayout {
visible: modelData.signalStrength !== undefined visible: modelData.signalStrength !== undefined
Layout.fillWidth: true Layout.fillWidth: true
spacing: Style.marginXS * scaling spacing: Style.marginXS * scaling
@ -115,8 +115,7 @@ ColumnLayout {
} }
NText { NText {
visible: modelData.signalStrength > 0 && !modelData.pairing visible: modelData.signalStrength > 0 && !modelData.pairing && !modelData.blocked
&& !modelData.blocked
text: (modelData.signalStrength !== undefined text: (modelData.signalStrength !== undefined
&& modelData.signalStrength > 0) ? modelData.signalStrength + "%" : "" && modelData.signalStrength > 0) ? modelData.signalStrength + "%" : ""
font.pointSize: Style.fontSizeXS * scaling font.pointSize: Style.fontSizeXS * scaling
@ -171,10 +170,9 @@ ColumnLayout {
BluetoothService.disconnectDevice(modelData) BluetoothService.disconnectDevice(modelData)
} else { } else {
BluetoothService.connectDeviceWithTrust(modelData) BluetoothService.connectDeviceWithTrust(modelData)
} }
} }
onRightClicked: onRightClicked: {
{
BluetoothService.forgetDevice(modelData) BluetoothService.forgetDevice(modelData)
} }
} }

View file

@ -97,7 +97,7 @@ NPanel {
// Known devices // Known devices
BluetoothDevicesList { BluetoothDevicesList {
label: "Known devices" label: "Known devices"
tooltipText: "Left click to connect, right click to forget" tooltipText: "Left click to connect.\nRight click to forget."
property var items: { property var items: {
if (!BluetoothService.adapter || !Bluetooth.devices) if (!BluetoothService.adapter || !Bluetooth.devices)
return [] return []
@ -124,9 +124,9 @@ NPanel {
Layout.fillWidth: true Layout.fillWidth: true
} }
// Fallback // Fallback - No devices, scanning
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter
spacing: Style.marginM * scaling spacing: Style.marginM * scaling
visible: { visible: {
if (!BluetoothService.adapter || !BluetoothService.adapter.discovering || !Bluetooth.devices) { if (!BluetoothService.adapter || !BluetoothService.adapter.discovering || !Bluetooth.devices) {
@ -144,11 +144,11 @@ NPanel {
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: Style.marginM * scaling spacing: Style.marginXS * scaling
NIcon { NIcon {
text: "sync" text: "sync"
font.pointSize: Style.fontSizeXLL * 1.5 * scaling font.pointSize: Style.fontSizeXXL * 1.5 * scaling
color: Color.mPrimary color: Color.mPrimary
RotationAnimation on rotation { RotationAnimation on rotation {
@ -164,12 +164,11 @@ NPanel {
text: "Scanning for devices..." text: "Scanning for devices..."
font.pointSize: Style.fontSizeL * scaling font.pointSize: Style.fontSizeL * scaling
color: Color.mOnSurface color: Color.mOnSurface
font.weight: Style.fontWeightMedium
} }
} }
NText { NText {
text: "Make sure your device is in pairing mode" text: "Make sure your device is in pairing mode."
font.pointSize: Style.fontSizeM * scaling font.pointSize: Style.fontSizeM * scaling
color: Color.mOnSurfaceVariant color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View file

@ -120,7 +120,6 @@ Singleton {
return "" return ""
} }
function getSignalStrength(device) { function getSignalStrength(device) {
if (!device || device.signalStrength === undefined || device.signalStrength <= 0) { if (!device || device.signalStrength === undefined || device.signalStrength <= 0) {
return "Signal: Unknown" return "Signal: Unknown"