Editor: Allow setting the optional action mask per editor

Instead of just enable actions that were disabled from the beginning you
can no disable optional actions.

Change-Id: I986b8a72523a8aeec9f4ccf76cd4921018ffc003
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2020-06-17 10:28:27 +02:00
parent c7db952648
commit aaa1376576
4 changed files with 22 additions and 8 deletions

View File

@@ -543,9 +543,8 @@ void TextEditorActionHandlerPrivate::updateActions()
void TextEditorActionHandlerPrivate::updateOptionalActions()
{
uint optionalActions = m_optionalActions;
if (m_currentEditorWidget)
optionalActions |= m_currentEditorWidget->optionalActionMask();
const uint optionalActions = m_currentEditorWidget ? m_currentEditorWidget->optionalActions()
: m_optionalActions;
m_followSymbolAction->setEnabled(
optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor);
m_followSymbolInNextSplitAction->setEnabled(
@@ -622,6 +621,11 @@ TextEditorActionHandler::TextEditorActionHandler(Core::Id editorId,
d->m_findTextWidget = TextEditorWidget::fromEditor;
}
uint TextEditorActionHandler::optionalActions() const
{
return d->m_optionalActions;
}
TextEditorActionHandler::~TextEditorActionHandler()
{
delete d;