forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user