diff options
| -rw-r--r-- | desktop/modules/bluetooth/BluetoothPage.qml | 50 | ||||
| -rw-r--r-- | desktop/modules/bluetooth/README.md | 7 |
2 files changed, 52 insertions, 5 deletions
diff --git a/desktop/modules/bluetooth/BluetoothPage.qml b/desktop/modules/bluetooth/BluetoothPage.qml index 5bfdc0b..a4ba232 100644 --- a/desktop/modules/bluetooth/BluetoothPage.qml +++ b/desktop/modules/bluetooth/BluetoothPage.qml @@ -180,12 +180,52 @@ Column { } } - Text { + // A failed pairing leaves the real bluetoothctl output here. No timeout: + // it stays until dismissed, and the next failure sets it again, so an + // identical error reappears rather than staying hidden. Dismissing clears + // the source, not a local flag, so it survives this page unloading. The + // desktop notification is sent separately and is not touched by this. + Rectangle { width: page.width visible: page.bt.pairing.error !== "" - wrapMode: Text.Wrap - text: page.bt.pairing.error - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } - color: Theme.red + implicitHeight: errText.implicitHeight + 16 + radius: 8 + color: Qt.alpha(Theme.red, 0.12) + border.width: 1 + border.color: Qt.alpha(Theme.red, 0.35) + + Text { + id: errText + anchors { + left: parent.left; leftMargin: 10 + right: errClose.left; rightMargin: 8 + verticalCenter: parent.verticalCenter + } + wrapMode: Text.Wrap + text: page.bt.pairing.error + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } + color: Theme.red + } + + Text { + id: errClose + anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter } + width: 20 + height: 20 + text: "\uf00d" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font { family: Theme.iconFamily; pixelSize: 13 } + color: errCloseArea.containsMouse ? Theme.red : Theme.subtext + + MouseArea { + id: errCloseArea + anchors.fill: parent + anchors.margins: -6 + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: page.bt.pairing.error = "" + } + } } } diff --git a/desktop/modules/bluetooth/README.md b/desktop/modules/bluetooth/README.md index 5a79060..d8057f4 100644 --- a/desktop/modules/bluetooth/README.md +++ b/desktop/modules/bluetooth/README.md @@ -38,6 +38,13 @@ Everything else is native `Quickshell.Bluetooth`. The cost is that the error shows, rather than pairing. `Pairing.qml` carries a `ponytail:` comment naming that and the upgrade path. +A failure surfaces twice. A desktop notification (`--urgency=critical`, so the +daemon gives it no expiry) is sent regardless of where the user is, and the +page shows the real `bluetoothctl` output in a red card. The card has no +timeout and is dismissed by clearing `pairing.error`, so the next failure +reappears even when the text is identical. Dismissing does not recall the +notification. + ## Not built Connecting and forgetting report no failure signal in the BlueZ binding; only |
