forked from Shinonome/dots-hyprland
Disable Bluetooth buttons for systems without Bluetooth
This commit is contained in:
@@ -301,6 +301,7 @@ Item { // Bar content region
|
|||||||
color: rightSidebarButton.colText
|
color: rightSidebarButton.colText
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
|
visible: BluetoothStatus.available
|
||||||
text: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
text: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.larger
|
||||||
color: rightSidebarButton.colText
|
color: rightSidebarButton.colText
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import Quickshell.Hyprland
|
|||||||
|
|
||||||
QuickToggleButton {
|
QuickToggleButton {
|
||||||
id: root
|
id: root
|
||||||
|
visible: BluetoothStatus.available
|
||||||
toggled: BluetoothStatus.enabled
|
toggled: BluetoothStatus.enabled
|
||||||
buttonIcon: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
buttonIcon: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ Item { // Bar content region
|
|||||||
color: rightSidebarButton.colText
|
color: rightSidebarButton.colText
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
|
visible: BluetoothStatus.available
|
||||||
text: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
text: BluetoothStatus.connected ? "bluetooth_connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth_disabled"
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.larger
|
||||||
color: rightSidebarButton.colText
|
color: rightSidebarButton.colText
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import QtQuick
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
readonly property bool available: Bluetooth.adapters.values.length > 0
|
||||||
readonly property bool enabled: Bluetooth.defaultAdapter?.enabled ?? false
|
readonly property bool enabled: Bluetooth.defaultAdapter?.enabled ?? false
|
||||||
readonly property BluetoothDevice firstActiveDevice: Bluetooth.defaultAdapter?.devices.values.find(device => device.connected) ?? null
|
readonly property BluetoothDevice firstActiveDevice: Bluetooth.defaultAdapter?.devices.values.find(device => device.connected) ?? null
|
||||||
readonly property int activeDeviceCount: Bluetooth.defaultAdapter?.devices.values.filter(device => device.connected).length ?? 0
|
readonly property int activeDeviceCount: Bluetooth.defaultAdapter?.devices.values.filter(device => device.connected).length ?? 0
|
||||||
|
|||||||
Reference in New Issue
Block a user