bouncy button group for toggles

This commit is contained in:
end-4
2025-05-24 13:10:49 +02:00
parent e7e55e7f95
commit 0cf12bc3be
6 changed files with 64 additions and 37 deletions
@@ -11,22 +11,12 @@ import Quickshell.Hyprland
QuickToggleButton {
toggled: Bluetooth.bluetoothEnabled
buttonIcon: Bluetooth.bluetoothConnected ? "bluetooth_connected" : Bluetooth.bluetoothEnabled ? "bluetooth" : "bluetooth_disabled"
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton | Qt.LeftButton
onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton) {
toggleBluetooth.running = true
}
if (mouse.button === Qt.RightButton) {
Hyprland.dispatch(`exec ${ConfigOptions.apps.bluetooth}`)
Hyprland.dispatch("global quickshell:sidebarRightClose")
}
}
hoverEnabled: false
propagateComposedEvents: true
cursorShape: Qt.PointingHandCursor
onClicked: {
toggleBluetooth.running = true
}
altAction: () => {
Hyprland.dispatch(`exec ${ConfigOptions.apps.bluetooth}`)
Hyprland.dispatch("global quickshell:sidebarRightClose")
}
Process {
id: toggleBluetooth