Add bluetooth panel (wip), add clock / clock+date setting
This commit is contained in:
parent
56ad08816e
commit
2fd20c69f9
9 changed files with 911 additions and 9 deletions
58
Modules/Bar/Bluetooth.qml
Normal file
58
Modules/Bar/Bluetooth.qml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
NIconButton {
|
||||
id: root
|
||||
|
||||
readonly property bool bluetoothEnabled: Settings.data.network.bluetoothEnabled
|
||||
sizeMultiplier: 0.8
|
||||
showBorder: false
|
||||
visible: bluetoothEnabled
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("[Bluetooth] Component loaded, bluetoothEnabled:", bluetoothEnabled)
|
||||
console.log("[Bluetooth] BluetoothService available:", typeof BluetoothService !== 'undefined')
|
||||
if (typeof BluetoothService !== 'undefined') {
|
||||
console.log("[Bluetooth] Connected devices:", BluetoothService.connectedDevices.length)
|
||||
}
|
||||
}
|
||||
icon: {
|
||||
// Show different icons based on connection status
|
||||
if (BluetoothService.connectedDevices.length > 0) {
|
||||
return "bluetooth_connected"
|
||||
} else if (BluetoothService.isDiscovering) {
|
||||
return "bluetooth_searching"
|
||||
} else {
|
||||
return "bluetooth"
|
||||
}
|
||||
}
|
||||
tooltipText: "Bluetooth Devices"
|
||||
onClicked: {
|
||||
if (!bluetoothMenuLoader.active) {
|
||||
bluetoothMenuLoader.isLoaded = true
|
||||
}
|
||||
if (bluetoothMenuLoader.item) {
|
||||
if (bluetoothMenuLoader.item.visible) {
|
||||
// Panel is visible, hide it with animation
|
||||
if (bluetoothMenuLoader.item.hide) {
|
||||
bluetoothMenuLoader.item.hide()
|
||||
} else {
|
||||
bluetoothMenuLoader.item.visible = false
|
||||
}
|
||||
} else {
|
||||
// Panel is hidden, show it
|
||||
bluetoothMenuLoader.item.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BluetoothMenu {
|
||||
id: bluetoothMenuLoader
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue