D8954: kdevelop: prevent empty dockwidget context menuitems
René J.V. Bertin
noreply at phabricator.kde.org
Wed Nov 22 16:49:25 UTC 2017
rjvbb created this revision.
rjvbb added a reviewer: kfunk.
rjvbb added a project: KDevelop.
Restricted Application added a subscriber: kdevelop-devel.
This patch prevents dock widgets (toolviews) from having empty items in their context menus. Most the corresponding actions can probably not be represented in menus anyway and are thus unlikely to do anything when triggered through a menu. The average user doesn't know that though.
The patch achieves this by filtering out QActions that would not have a title in `IdealDockWidget::contextMenuRequested()` but also adds a menu item text to two actions which I think make sense to include in the context menu. (Doing this makes it possible to hide the toolview's toolbar in more situations, gaining a bit of vertical space.)
Works as intended on Mac and Linux/X11 .
I understand there may be another way to detect QActions that cannot be represented in menus but haven't yet found such an alternative. Such an alternative could be used in addition to the empty text check which I think should be done as argued in the summary.
Individual plugins can also override `IToolViewFactor::contextMenuActions()`.
To: rjvbb, kfunk
Cc: kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel