[Task Manager] Align context menu to task item

Review Request #125589 - Created Oct. 10, 2015 and submitted

Kai Uwe Broulik
plasma, usability

One thing that always bugged me with the Plasma 5 Task Manager was the context menu covering the task item (I have a top panel) when I, conforming to Fitt's Law, threw my mouse at the edge and right clicked.

This also restores Plasma 4 behavior where the context menus din't overlap the panels. I chose to align the context menu with the item itself rather than just the panel, which is what Plasma 4 did, to communicate some affinity to the task item, especially in multi-row task managers.

I changed the QMetaObject::invokeMethod to a QTimer::singleShot with lambda, don't know if that's the right approach. Also it's perhaps not optimal for me to copy the QPoint into the lambda.

Tested with single and multi row task manager in top/bottom/left/right panels. Works. Did not test with multiple monitors.

Perhaps some margins need to be taken into account additionally, note the small gap between the indicator line and the menu border


Kai Uwe Broulik
Eike Hein
Eike Hein
Thomas Pfeiffer
Kai Uwe Broulik
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 4a690053b1dff685f7f3c1a60ac16a925f2f54a3 by Kai Uwe Broulik to branch master.