added quickshell config
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import QtQuick
|
||||
import Quickshell.Bluetooth
|
||||
import "../../config"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: label.implicitWidth + 4
|
||||
implicitHeight: Appearance.barHeight
|
||||
|
||||
readonly property var adapter: Bluetooth.defaultAdapter
|
||||
readonly property bool anyConnected: {
|
||||
if (!adapter) return false
|
||||
const devices = adapter.devices.values
|
||||
for (let i = 0; i < devices.length; i++) {
|
||||
if (devices[i].connected) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
font.family: Appearance.iconFontFamily
|
||||
font.variableAxes: Appearance.iconFontAxes
|
||||
font.pixelSize: 16
|
||||
color: (root.adapter && root.adapter.enabled) ? Colors.foreground : Colors.muted
|
||||
text: {
|
||||
if (!root.adapter || !root.adapter.enabled) return "bluetooth_disabled"
|
||||
return root.anyConnected ? "bluetooth_connected" : "bluetooth"
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: if (root.adapter) root.adapter.enabled = !root.adapter.enabled
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user