diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-20 11:45:11 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-20 11:45:11 +0200 |
| commit | dd8a4ee43c045230fa982c7ee49166f7c8c6529b (patch) | |
| tree | 303fa40adeceb2d09de49bfcc238deca294c57b9 /desktop/modules/bluetooth/BluetoothPage.qml | |
| parent | 59c4a841b7107f6b21bcd1c8f120c8caf1bd2d7c (diff) | |
| download | quickshell-dd8a4ee43c045230fa982c7ee49166f7c8c6529b.tar.gz quickshell-dd8a4ee43c045230fa982c7ee49166f7c8c6529b.zip | |
feat(desktop): dismissable bluetooth pairing error on the page
A failed pairing showed the raw bluetoothctl output as a plain red line that
only cleared on the next attempt, and the desktop notification is suppressed
while the drawer is open, so the failure was easy to miss and impossible to
dismiss.
Show it in a red card with a close control that clears pairing.error. It has
no timeout, and clearing the source means the next identical failure shows
again rather than staying hidden.
Diffstat (limited to 'desktop/modules/bluetooth/BluetoothPage.qml')
| -rw-r--r-- | desktop/modules/bluetooth/BluetoothPage.qml | 50 |
1 files changed, 45 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 = "" + } + } } } |
