1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-04 01:42:44 +00:00

Guess device icons

Device icons for the local device is now determined by looking at what
the value of the deviceType property of the ApiClient is. This property
was newly introduced, so that applications using JellyfinQt can set
their own device type.

For other devices, a guess is made based on the client name. This guess
has been derived from what Jellyfin Web does.
This commit is contained in:
Chris Josten 2024-01-02 15:14:23 +01:00
parent 1b27847c94
commit 9266f65c2f
7 changed files with 86 additions and 12 deletions

View file

@ -51,6 +51,7 @@ ApplicationWindow {
id: _apiClient
objectName: "Test"
appName: "Sailfin"
deviceType: DeviceType.Phone
supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayMessage]
}

View file

@ -34,7 +34,19 @@ Page {
}
height: parent.contentHeight - 2 * Theme.paddingMedium
width: height
source: "image://theme/icon-m-computer"
source: {
if (model.deviceType == J.DeviceType.Phone) {
return "image://theme/icon-m-device"
} else if (model.deviceType == J.DeviceType.Tv) {
// For the lack of a better icon
return "image://theme/icon-m-device-landscape"
} else if (model.deviceType == J.DeviceType.Computer) {
return "image://theme/icon-m-computer"
} else {
//case J.DeviceType.Unknown:
return "image://theme/icon-m-question"
}
}
highlighted: parent.down || isConnected
}
Column {