Fix Layout, more changes to modular bar

This commit is contained in:
Ly-sec 2025-08-22 18:13:18 +02:00
parent 12092ca6f6
commit f441bec32d
5 changed files with 212 additions and 237 deletions

View file

@ -7,6 +7,7 @@ import qs.Commons
import qs.Services
import qs.Widgets
NIconButton {
id: root
@ -32,7 +33,30 @@ NIconButton {
bluetoothPanel.toggle(screen)
}
BluetoothPanel {
Loader {
id: bluetoothPanel
source: "BluetoothPanel.qml"
active: false
property var pendingToggleScreen: null
onStatusChanged: {
if (status === Loader.Ready && item && pendingToggleScreen !== null) {
item.toggle(pendingToggleScreen)
pendingToggleScreen = null
}
}
function toggle(screen) {
// Load the panel if it's not already loaded
if (!active) {
active = true
pendingToggleScreen = screen
} else if (status === Loader.Ready && item) {
item.toggle(screen)
} else {
pendingToggleScreen = screen
}
}
}
}