D8054: Show headset icons for devices identifying as "Headset" in Description

Guilherme Silva noreply at phabricator.kde.org
Tue Apr 24 08:49:17 UTC 2018


guilhermesilva added a comment.


  Hi guys! Sorry to "necro-bump" this issue, but I wanted to share my opinion on this new approach of setting the device icon. From what I've been seeing in random screenshots of the `plasma-pa` applet, most of the times they all have the same icon: `audio-card.svg`. That's because, apparently, for a lot of people (myself included), the `device.form_factor` property is set to `internal` in all sinks:
  
    $ pacmd list sinks | grep device.form_factor
    device.form_factor = "internal"
    device.form_factor = "internal"
    device.form_factor = "internal"
    device.form_factor = "internal"
  
  So, the the device list in `plasma-pa` end up looking like this:
  
  F5820254: new.png <https://phabricator.kde.org/F5820254>
  
  While that's not really a big deal for most people, I really think the previous "hacky" approach delivered better-looking results:
  
  F5820257: previous.png <https://phabricator.kde.org/F5820257>
  
  I don't know if that's an issue with PulseAudio, but for now I decided to downgrade the `plasma-pa` package back to version `5.11.5`. I've also made an adaptation in `contents/ui/DeviceListItem.qml`, because my speakers port is named `analog-output-lineout`, so I wasn't getting the proper icon as well. Ah, I've also changed the `audio-speakers-symbolic` icon to just `audio-speakers` because I didn't like it:
  
    diff --git a/applet/contents/ui/DeviceListItem.qml b/applet/contents/ui/DeviceListItem.qml
    index 642ca02..2302160 100644
    --- a/applet/contents/ui/DeviceListItem.qml
    +++ b/applet/contents/ui/DeviceListItem.qml
    @@ -27,8 +27,8 @@ ListItemBase {
         label: currentPort ? i18nc("label of device items", "%1 (%2)", currentPort.description, Description) : Description
         icon: {
             if (currentPort) {
    -            if (currentPort.name.indexOf("speaker") != -1) {
    -                return "audio-speakers-symbolic";
    +            if (currentPort.name.indexOf("speaker") != -1 || currentPort.name.indexOf("lineout") != -1) {
    +                return "audio-speakers";
                 } else if (currentPort.name.indexOf("headphones") != -1) {
                     return "audio-headphones";
                 } else if (currentPort.name.indexOf("hdmi") != -1) {
  
  I hope you guys can reconsider the decision of relying on `device.form_factor`.
  
  Thanks a lot!

REPOSITORY
  R115 Plasma Audio Volume Applet

REVISION DETAIL
  https://phabricator.kde.org/D8054

To: antlarr, #plasma, davidedmundson, drosca
Cc: guilhermesilva, andreask, drosca, sebas, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180424/bfe06e80/attachment.html>


More information about the Plasma-devel mailing list