pragma ComponentBehavior: Bound import QtQuick import QtQuick.Layouts import Quickshell.Bluetooth import "../controls" import "../../components" import "../../services" SettingsPage { SettingsSection { SettingRow { title: "Bluetooth" description: BluetoothService.adapter ? BluetoothService.summary : "No Bluetooth adapter" icon: "󰂯" GlassToggle { checked: BluetoothService.enabled enabled: !!BluetoothService.adapter && BluetoothService.adapter.state !== BluetoothAdapterState.Blocked onClicked: { BluetoothService.toggle(); checked = Qt.binding(() => BluetoothService.enabled); } Accessible.name: "Bluetooth power" } } SettingRow { title: "Adapter" icon: "󰂰" GlassComboBox { Layout.preferredWidth: 240 model: BluetoothService.adapters.map(a => a.name) currentIndex: BluetoothService.adapters.indexOf(BluetoothService.adapter) enabled: BluetoothService.adapters.length > 0 onActivated: BluetoothService.adapterId = BluetoothService.adapters[currentIndex].adapterId } } SettingRow { title: "Pairing" description: "Pairing and PIN confirmation use the existing Bluetooth manager. Paired devices can connect here." icon: "󰒓" GlassButton { text: "Pair devices…" enabled: !SystemService.acting onClicked: SystemService.action("manager", "bluetooth", false) } } } SettingsSection { title: "Devices" visible: devices.count > 0 Repeater { id: devices model: BluetoothService.devices.filter(d => d.paired) SettingRow { id: entry required property var modelData title: modelData.name description: BluetoothDeviceState.toString(modelData.state) + (modelData.batteryAvailable ? " · " + Math.round(modelData.battery * 100) + "%" : "") icon: modelData.connected ? "󰂱" : "󰂯" GlassButton { text: entry.modelData.connected ? "Disconnect" : "Connect" accented: !entry.modelData.connected enabled: BluetoothService.enabled && !BluetoothService.pending onClicked: BluetoothService.connectDevice(entry.modelData) } } } } SettingNote { warning: true text: BluetoothService.error } SettingNote { warning: true text: SystemService.error } }