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.

REVISION SUMMARY
  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.)
  
  BUG: 386911

TEST PLAN
  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()`.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D8954

AFFECTED FILES
  kdevplatform/sublime/idealdockwidget.cpp
  plugins/contextbrowser/contextbrowserview.cpp
  plugins/outlineview/outlinewidget.cpp

To: rjvbb, kfunk
Cc: kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20171122/3ecb54d4/attachment-0001.html>


More information about the KDevelop-devel mailing list