Skip to content
  • René J.V. Bertin's avatar
    kdevelop: prevent empty dockwidget context menuitems · f4363a08
    René J.V. Bertin authored and Kevin Funk's avatar Kevin Funk committed
    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
    FIXED-IN: 5.2.1
    
    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()`.
    
    Reviewers: kfunk
    
    Reviewed By: kfunk
    
    Subscribers: kdevelop-devel
    
    Tags: #kdevelop
    
    Differential Revision: https://phabricator.kde.org/D8954
    f4363a08