bluetooth: refractor and fix wrong icon

This commit is contained in:
end-4
2025-08-29 12:06:01 +07:00
parent b52440bcc1
commit d239ab6b1f
4 changed files with 27 additions and 16 deletions
@@ -285,10 +285,7 @@ Item { // Bar content region
color: rightSidebarButton.colText
}
MaterialSymbol {
readonly property bool bluetoothEnabled: Bluetooth.defaultAdapter?.enabled
readonly property BluetoothDevice bluetoothDevice: Bluetooth.defaultAdapter?.devices.values.find(device => device.connected)
readonly property bool bluetoothConnected: bluetoothDevice !== undefined
text: bluetoothConnected ? "bluetooth_connected" : bluetoothEnabled ? "bluetooth" : "bluetooth_disabled"
text: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
iconSize: Appearance.font.pixelSize.larger
color: rightSidebarButton.colText
}