Skip to content

[systemtray] Allow context actions to not show on header menu

Ismael Asensio requested to merge work/iasensio/systray-hide-actions into master

We can leverage the priority property of QActions, which is NormalPriority (128) by default, and hide it from systray header if the priority is set to LowPriority (0).

BUG: 446396

The choice of this property is somewhat casual, but I think it makes some sense and fits within the current API in a simple and non intrusive way. For a more fitted solution IMHO the plasmoid actions API would need to be redone.

An extension to this could be setting HighPriority (256) to make an action being shown standalone and not grouped in the hamburger menu.

TEST: The second commit sets the show percentage action in the battery applet to priority 0, just to demonstrate how it's not shown in the system tray header menu, but it's still accesible in the right-click context menu.

Merge request reports