dcontent/bt: settings toggle between
Make settings button go to first device if already on settings
This commit is contained in:
parent
1805840718
commit
c1b844b857
1 changed files with 6 additions and 1 deletions
|
|
@ -74,7 +74,11 @@ ColumnLayout {
|
||||||
accent: "Primary"
|
accent: "Primary"
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
|
if (root.session.bt.active)
|
||||||
root.session.bt.active = null;
|
root.session.bt.active = null;
|
||||||
|
else {
|
||||||
|
root.session.bt.active = deviceModel.values[0] ?? null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -137,6 +141,7 @@ ColumnLayout {
|
||||||
|
|
||||||
StyledListView {
|
StyledListView {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
|
id: deviceModel
|
||||||
values: [...Bluetooth.devices.values].sort((a, b) => (b.connected - a.connected) || (b.paired - a.paired))
|
values: [...Bluetooth.devices.values].sort((a, b) => (b.connected - a.connected) || (b.paired - a.paired))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue