<table><tr><td style="">rjvbb created this revision.<br />rjvbb added a reviewer: kfunk.<br />rjvbb added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8954" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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.</p>
<p>The patch achieves this by filtering out QActions that would not have a title in <tt style="background: #ebebeb; font-size: 13px;">IdealDockWidget::contextMenuRequested()</tt> 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.)</p>
<p>BUG: 386911</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Works as intended on Mac and Linux/X11 .</p>
<p>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.</p>
<p>Individual plugins can also override <tt style="background: #ebebeb; font-size: 13px;">IToolViewFactor::contextMenuActions()</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8954" rel="noreferrer">https://phabricator.kde.org/D8954</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/sublime/idealdockwidget.cpp<br />
plugins/contextbrowser/contextbrowserview.cpp<br />
plugins/outlineview/outlinewidget.cpp</div></div></div><br /><div><strong>To: </strong>rjvbb, kfunk<br /><strong>Cc: </strong>kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>