From 79f078653a9032c9d09e1eb2248c2294cc15c819 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 30 Aug 2025 07:55:29 +0200 Subject: [PATCH] bluetooth menu: stop scanning when closed, fix null warnings --- .../ii/modules/sidebarRight/SidebarRightContent.qml | 5 ++++- .../sidebarRight/bluetoothDevices/BluetoothDeviceItem.qml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/ii/modules/sidebarRight/SidebarRightContent.qml b/.config/quickshell/ii/modules/sidebarRight/SidebarRightContent.qml index b1adc3ae6..636d57729 100644 --- a/.config/quickshell/ii/modules/sidebarRight/SidebarRightContent.qml +++ b/.config/quickshell/ii/modules/sidebarRight/SidebarRightContent.qml @@ -181,7 +181,10 @@ Item { } } - onShowBluetoothDialogChanged: if (showBluetoothDialog) bluetoothDialogLoader.active = true; + onShowBluetoothDialogChanged: { + if (showBluetoothDialog) bluetoothDialogLoader.active = true; + else Bluetooth.defaultAdapter.discovering = false; + } Loader { id: bluetoothDialogLoader anchors.fill: parent diff --git a/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDeviceItem.qml b/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDeviceItem.qml index 19ee07234..fec9c4eb3 100644 --- a/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDeviceItem.qml +++ b/.config/quickshell/ii/modules/sidebarRight/bluetoothDevices/BluetoothDeviceItem.qml @@ -46,10 +46,10 @@ DialogListItem { Layout.fillWidth: true color: Appearance.colors.colOnSurfaceVariant elide: Text.ElideRight - text: root.device?.name + text: root.device?.name || Translation.tr("Unknown device") } StyledText { - visible: root.device?.connected || root.device?.paired + visible: (root.device?.connected || root.device?.paired) ?? false Layout.fillWidth: true font.pixelSize: Appearance.font.pixelSize.smaller color: Appearance.colors.colSubtext @@ -93,7 +93,7 @@ DialogListItem { } } ActionButton { - visible: root.device?.paired + visible: root.device?.paired ?? false colBackground: Appearance.colors.colError colBackgroundHover: Appearance.colors.colErrorHover colRipple: Appearance.colors.colErrorActive