Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/StreamListItem.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | 22 | | |||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | 24 | | |||
25 | import org.kde.plasma.private.volume 0.1 | 25 | import org.kde.plasma.private.volume 0.1 | ||
26 | 26 | | |||
27 | ListItemBase { | 27 | ListItemBase { | ||
28 | property bool onlyOne: false | 28 | property bool onlyOne: false | ||
29 | readonly property string maxVolumeTarget: if (Client) {return Client.name} | ||||
ngraham: Could be simplified and hardened to `Client ? Client.name : ""` | |||||
29 | 30 | | |||
30 | label: { | 31 | label: { | ||
31 | if (! Client) { | 32 | if (! Client) { | ||
32 | return Name | 33 | return Name | ||
33 | } else { | 34 | } else { | ||
34 | if (onlyOne) { | 35 | if (onlyOne) { | ||
35 | return Client.name | 36 | return Client.name | ||
36 | } else { | 37 | } else { | ||
37 | return i18nc("label of stream items", "%1 (%2)", Client.name, Name) | 38 | return i18nc("label of stream items", "%1 (%2)", Client.name, Name) | ||
38 | } | 39 | } | ||
39 | } | 40 | } | ||
40 | } | 41 | } | ||
41 | labelOpacity: onlyOne ? 1 : 0.6 | 42 | labelOpacity: onlyOne ? 1 : 0.6 | ||
42 | icon: IconName | 43 | icon: IconName | ||
43 | iconUsesPlasmaTheme: false | 44 | iconUsesPlasmaTheme: false | ||
44 | } | 45 | } |
Could be simplified and hardened to Client ? Client.name : ""