Skip to content

Commit

Permalink
Show list headers as strings.
Browse files Browse the repository at this point in the history
Previously, only the numerical value was shown. There's no existing code that
would do this elsewhere, so parsing is added as a js function on the qml page.
  • Loading branch information
Mazhoon authored and R1tschY committed Apr 8, 2024
1 parent f54e49e commit 32a789e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/qml/pages/DeviceListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Page {
id: sectionHeading

SectionHeader {
text: section
text: roleTexts(section)
}
}

Expand Down Expand Up @@ -276,6 +276,20 @@ Page {
onTriggered: startup = false
}

function roleTexts(section) {
switch(Number(section)) {
case DeviceListModel.Connected:
return i18n("Connected")
case DeviceListModel.Trusted:
return i18n("Paired devices")
case DeviceListModel.Near:
return i18n("Nearby devices")
case DeviceListModel.Nothing:
default:
return "-"
}
}

function openDevicePage(deviceId) {
if (typeof pageStack === "undefined")
return; // happens when using QmlLive
Expand Down

0 comments on commit 32a789e

Please sign in to comment.