[applets/showdesktop] Enterprise Edition: Fix Wayland bug, and refactor things
[applets/showdesktop] Rename things in a way that makes more sense
Besides, "component" is such an overloaded broad term in QML.
[applets/showdesktop] Get rid of extra Loader, use MinimizeAllController directly
We don't gain much with this delayed loading, and in fact it forces us
to keep showdesktop.minimizeAll()
method for the Plasmoid's action menu
which is otherwise already implemented in this controller.
[applets/showdesktop] Fix "Minimize All" context action on Wayland
Let's reuse the one from MinimizeAllController that "just works".
This change means that applet will be tracking minimized clients regardless of its primary role (Minimize / Peek). This needs some follow up changes to represent such state explicitly. But also it makes "Minimize All Windows" action menu affect the "active" state of the applet when it has "Minimize..." role, which is kind of an improvement.
[applets/showdesktop] Factor out strings for "Minimize All" into controller
[applets/showdesktop] Refactor peek/minimize controllers, and bind actions' text
Factoring out an "interface" (if one can call it like that in QML) for the two operation modes removes all the decision making from the main file, and delegates things like description text and toggle() method to implementations. It turns ?trinary: mess into a set of simple and straightforward bindings.
Test plan: applet works correctly in both configurations, on X11 and Wayland; it's menu actions have adaptive text labels, and triggering the one that matches applet's mode (primary controller) also updates the highlight (active applet) indicator.
[applets/showdesktop] Add checkboxes to context menu's Plasmoid actions
This way they reflect the actual state of their controllers, even for a controller that is not the primary operation mode of an applet and thus is not already reflected by an active applet indicator line.
The last commit needs some discussion. AFAIK according to any sane HIG a toggle action should either be a checkbox or change text, but not both at once. That why I designed Controller
interface in the way I did: to make such change as trivial as replacing action.text = Qt.binding(() => peekController.title);
binding with peekController.titleInactive
.
Note: I'm aiming for 5.26 branch.