Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/DeviceListItem.qml
Show All 19 Lines | |||||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | 22 | | |||
23 | import "../code/icon.js" as Icon | 23 | import "../code/icon.js" as Icon | ||
24 | 24 | | |||
25 | ListItemBase { | 25 | ListItemBase { | ||
26 | readonly property var currentPort: Ports[ActivePortIndex] | 26 | readonly property var currentPort: Ports[ActivePortIndex] | ||
27 | property bool onlyOne: false | 27 | property bool onlyOne: false | ||
28 | readonly property string maxVolumeTarget: currentPort ? currentPort.description + " (" + Description + ")" : Description | ||||
28 | 29 | | |||
29 | draggable: false | 30 | draggable: false | ||
30 | label: { | 31 | label: { | ||
31 | if (!currentPort) { | 32 | if (!currentPort) { | ||
32 | return Description | 33 | return Description | ||
33 | } else { | 34 | } else { | ||
34 | if (onlyOne) { | 35 | if (onlyOne) { | ||
35 | return currentPort.description | 36 | return currentPort.description | ||
36 | } else { | 37 | } else { | ||
37 | return i18nc("label of device items", "%1 (%2)", currentPort.description, Description) | 38 | return i18nc("label of device items", "%1 (%2)", currentPort.description, Description) | ||
38 | } | 39 | } | ||
39 | } | 40 | } | ||
40 | } | 41 | } | ||
41 | labelOpacity: onlyOne ? 1 : 0.6 | 42 | labelOpacity: onlyOne ? 1 : 0.6 | ||
42 | icon: Icon.formFactorIcon(FormFactor) || IconName | 43 | icon: Icon.formFactorIcon(FormFactor) || IconName | ||
43 | } | 44 | } |