Fix BT and WiFi panels
This commit is contained in:
parent
f441bec32d
commit
8bb6da5e0d
5 changed files with 10 additions and 56 deletions
|
|
@ -32,31 +32,4 @@ NIconButton {
|
|||
onClicked: {
|
||||
bluetoothPanel.toggle(screen)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue