✨ feat(bluetooth): control scanning based on other devices section visibility

This commit is contained in:
sankalp committed 2025-08-16 13:20:40 +05:45
1 parent 2eba79b98e
commit 73f3839d85
1 file changed
+10 -5
+10 -5
View File
@@ -328,13 +328,18 @@ class BluetoothConnections(Box):
current_state = self.other_devices_revealer.child_revealed
self.other_devices_revealer.child_revealed = not current_state
# Update button text based on state
if self.other_devices_revealer.child_revealed:
# Trigger a scan when revealing other devices and force refresh
if self.client:
self.client.toggle_scan()
# Handle scanning based on section visibility
if self.client:
if self.other_devices_revealer.child_revealed:
# Start scanning when revealing other devices section
if not self.client.scanning:
self.client.toggle_scan()
# Also force an immediate device refresh to catch any missed connections
self.force_device_refresh()
else:
# Stop scanning when hiding other devices section
if self.client.scanning:
self.client.toggle_scan()
def open_bluetooth_settings(self, *_):
"""Open Blueman bluetooth manager"""