Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/DeviceListItem.qml
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | 22 | | |||
23 | ListItemBase { | 23 | ListItemBase { | ||
24 | readonly property var currentPort: Ports[ActivePortIndex] | 24 | readonly property var currentPort: Ports[ActivePortIndex] | ||
25 | property bool onlyOne: false | ||||
25 | 26 | | |||
26 | draggable: false | 27 | draggable: false | ||
27 | label: currentPort ? i18nc("label of device items", "%1 (%2)", currentPort.description, Description) : Description | 28 | label: { | ||
29 | if (!currentPort) { | ||||
30 | return Description | ||||
31 | } else { | ||||
32 | if (onlyOne) { | ||||
33 | return currentPort.description | ||||
34 | } else { | ||||
35 | return i18nc("label of device items", "%1 (%2)", currentPort.description, Description) | ||||
36 | } | ||||
37 | } | ||||
38 | } | ||||
39 | labelOpacity: onlyOne ? 1 : 0.6 | ||||
drosca: Why do you change opacity? It makes it inconsistent with applications tab. | |||||
Check out the screenshot. If I hadn't conditionally changed the opacity here, then in the Simple Mode, the header text would look very light, instead of being fully opaque.= the way it should be. ngraham: Check out the screenshot. If I hadn't conditionally changed the opacity here, then in the… | |||||
28 | icon: { | 40 | icon: { | ||
29 | switch(FormFactor) { | 41 | switch(FormFactor) { | ||
30 | case "internal": | 42 | case "internal": | ||
31 | return "audio-card"; | 43 | return "audio-card"; | ||
32 | case "speaker": | 44 | case "speaker": | ||
33 | return "audio-speakers-symbolic"; | 45 | return "audio-speakers-symbolic"; | ||
34 | case "phone": | 46 | case "phone": | ||
35 | return "phone"; | 47 | return "phone"; | ||
Show All 26 Lines |
Why do you change opacity? It makes it inconsistent with applications tab.