Context Menu to Mute, Set Default Sink/Source, Active Port
AbandonedPublic

Authored by Zren on Jul 30 2016, 5:16 PM.

Details

Reviewers
None
Group Reviewers
Plasma: Design
Plasma
Summary
  • Only shows ports if there's more than 1 port.
  • Doesn't show Default/Ports on apps (typeof PulseObject.key !== 'type' check).
  • Based on the taskmanager widget's context menu.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
Zren updated this revision to Diff 5576.Jul 30 2016, 5:16 PM
Zren retitled this revision from to Context Menu to Mute, Set Default Sink/Source, Active Port.
Zren updated this object.
Zren edited the test plan for this revision. (Show Details)
Zren set the repository for this revision to R115 Plasma Audio Volume Applet.
Restricted Application added a project: Plasma. · View Herald TranscriptJul 30 2016, 5:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Zren updated this object.Jul 30 2016, 5:18 PM
Zren updated this revision to Diff 5578.Jul 30 2016, 5:38 PM
Zren removed R115 Plasma Audio Volume Applet as the repository for this revision.

Remove line I missed when copy pasting.

Zren set the repository for this revision to R115 Plasma Audio Volume Applet.Jul 31 2016, 4:40 AM
apol added a subscriber: apol.Aug 1 2016, 12:43 AM
apol removed a subscriber: apol.

@colomar Can you please comment on this? We have been talking about using a context menu in plasmoid, but I don't remember what was the final decision from the VDG?

Do we need to do it programatically? It's should be do-able in a declarative way with Instantiator

ContextMenu
{

MenuItem {
       text: i18n("Mute");
       ...
}

MenuItem {
       text: i18n("Default");
       visible: .....
}

Instantiator
{
     model:  PulseObject.ports
     delegate: MenuItem {}
}

}

Edit: sorry didn't see drosca replied.
Wait till the VDG reply before doing any changes (as you don't want it to be wasted)

Zren added a comment.Oct 26 2016, 12:44 PM

Do we need to do it programatically?

All I did was copy the Menu widget's pattern (sorta) since it was the first example I could find. It would need to populate hundreds of menu's (most unused), so that makes sense that it would do things dynamically.

Not sure if VDG has talked about this yet, but here's a few things that could be added on top of the this context menu:

  • Toggle Volume Boost (between 100% and 150%) so maximum isn't always 150%.
  • Selecting "Default [device]" can move all the current app streams to that device.

https://github.com/Zren/plasma-applets/blob/master/org.kde.plasma.volumewin7mixer/package/contents/ui/MixerItem.qml#L455

In D2314#58816, @Zren wrote:

All I did was copy the Menu widget's pattern (sorta) since it was the first example I could find.

Yeah, PlasmaComponents.ContextMenu sucks but if possible, I would prefer the declarative approach too. If not, then fine, but at least replace the Qt.createQmlObject with Component.createObject.

Not sure if VDG has talked about this yet, but here's a few things that could be added on top of the this context menu:

  • Toggle Volume Boost (between 100% and 150%) so maximum isn't always 150%.
  • Selecting "Default [device]" can move all the current app streams to that device.

Sure, if we have a context menu I am not against adding a few more features to it. However, the main question for VDG is if we may actually have the context menu at all.

Sorry for not replying earlier.
There is nothing that speaks against offering this context menu. However, all the actions in the context menu must be available in the main UI as well. Due to discoverability reasons, context menus must never be the only way to access an action.
So, this patch is good to go, but there needs to be a way to do these things without the context menu as well.

drosca added a comment.Nov 5 2016, 9:01 AM

However, all the actions in the context menu must be available in the main UI as well.
So, this patch is good to go, but there needs to be a way to do these things without the context menu as well.

Is it ok that some actions are available only from Audio Volume KCM and not the applet itself (in this case, it is the change default device action and changing the active port)? These actions are not available from applet, because applet is meant to be simple. But I think it would be good to be able to quickly access these actions, even if it means using "hidden" context menu.

Zren added a comment.Nov 17 2016, 1:03 AM

The Instantiator pattern will not work.

https://i.imgur.com/CVKMnnU.png

"content" is PlasmaComponent.ContextMenu's " default property (the list of child objects like MenuItem).
https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/plasmacomponents/qmenu.h#L73

broulik added a subscriber: broulik.Jan 4 2018, 4:09 PM

This is obsolete now?

Zren abandoned this revision.Apr 5 2018, 8:08 PM

Yep, D4751 was used instead.