bluetooth menu

This commit is contained in:
end-4
2025-08-30 07:51:18 +02:00
parent 59abffb1c1
commit a952ea02dc
10 changed files with 276 additions and 39 deletions
@@ -1,18 +1,15 @@
import qs
import qs.services
import qs.services.network
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
import "./quickToggles/"
import "./wifiNetworks/"
import "./bluetoothDevices/"
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Quickshell.Io
import Quickshell
import Quickshell.Wayland
import Quickshell.Bluetooth
import Quickshell.Hyprland
Item {
@@ -21,12 +18,14 @@ Item {
property int sidebarPadding: 12
property string settingsQmlPath: Quickshell.shellPath("settings.qml")
property bool showWifiDialog: false
property bool showBluetoothDialog: false
Connections {
target: GlobalStates
function onSidebarRightOpenChanged() {
if (!GlobalStates.sidebarRightOpen) {
root.showWifiDialog = false;
root.showBluetoothDialog = false;
}
}
}
@@ -129,7 +128,13 @@ Item {
root.showWifiDialog = true;
}
}
BluetoothToggle {}
BluetoothToggle {
altAction: () => {
Bluetooth.defaultAdapter.enabled = true;
Bluetooth.defaultAdapter.discovering = true;
root.showBluetoothDialog = true;
}
}
NightLight {}
GameMode {}
IdleInhibitor {}
@@ -138,7 +143,6 @@ Item {
}
CenterWidgetGroup {
focus: sidebarRoot.visible
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.fillWidth: true
@@ -176,4 +180,28 @@ Item {
}
}
}
onShowBluetoothDialogChanged: if (showBluetoothDialog) bluetoothDialogLoader.active = true;
Loader {
id: bluetoothDialogLoader
anchors.fill: parent
active: root.showBluetoothDialog || item.visible
onActiveChanged: {
if (active) {
item.show = true;
item.forceActiveFocus();
}
}
sourceComponent: BluetoothDialog {
onDismiss: {
show = false
root.showBluetoothDialog = false
}
onVisibleChanged: {
if (!visible && !root.showBluetoothDialog) bluetoothDialogLoader.active = false;
}
}
}
}