Commit 5f6b2907 authored by Sefa Eyeoglu's avatar Sefa Eyeoglu Committed by Nate Graham
Browse files

Fix wrong KCM device icon for specific form factors

Summary:
The KCM did not know how different form factors should be displayed. The applet uses a functiun in "icon.js" to find out which icon to use. I have ported this over to the KCM.

Related: D24161

Test Plan:
Connect phone via Bluetooth and play music.

Now: "phone" icon appears
{F7458234}

Before: "audio-card" icon appears,
{F7458236}

Reviewers: #vdg, #plasma, ngraham, GB_2

Reviewed By: #vdg, ngraham

Subscribers: #plasma, plasma-devel, #vdg

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24289
parent 608e9e6f
/*
Copyright 2014-2015 Harald Sitter <sitter@kde.org>
Copyright 2019 Sefa Eyeoglu <contact@scrumplex.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -36,3 +35,37 @@ function name(volume, muted, prefix) {
}
return icon;
}
function formFactorIcon(formFactor) {
switch(formFactor) {
case "internal":
return "audio-card";
case "speaker":
return "audio-speakers-symbolic";
case "phone":
return "phone";
case "handset":
return "phone";
case "tv":
return "video-television";
case "webcam":
return "camera-web";
case "microphone":
return "audio-input-microphone";
case "headset":
return "audio-headset";
case "headphone":
return "audio-headphones";
case "hands-free":
return "hands-free";
case "car":
return "car";
case "hifi":
return "hifi";
case "computer":
return "computer";
case "portable":
return "portable";
}
return "";
}
......@@ -25,6 +25,7 @@ import QtQuick.Layouts 1.0
import org.kde.kirigami 2.5 as Kirigami
import org.kde.plasma.private.volume 0.1
import "../code/icon.js" as Icon
ColumnLayout {
id: delegate
......@@ -39,7 +40,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: delegateColumn.height * 0.75
Layout.preferredWidth: Layout.preferredHeight
source: IconName || "audio-card"
source: Icon.formFactorIcon(FormFactor) || IconName || "audio-card"
}
ColumnLayout {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment