forked from qt-creator/qt-creator
Added 'NoModeSwitch' flag to EditorManager::activateEditor
This allows a different mode to activate an editor without necessarily switching to the text/debug mode. Used in Bauhaus. Reviewed-by: con
This commit is contained in:
@@ -904,8 +904,10 @@ Core::IEditor *EditorManager::activateEditor(Core::Internal::EditorView *view, C
|
|||||||
|
|
||||||
if (!(flags & NoActivate)) {
|
if (!(flags & NoActivate)) {
|
||||||
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
||||||
ensureEditorManagerVisible();
|
if (!(flags & NoModeSwitch))
|
||||||
editor->widget()->setFocus();
|
ensureEditorManagerVisible();
|
||||||
|
if (isVisible())
|
||||||
|
editor->widget()->setFocus();
|
||||||
}
|
}
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ public:
|
|||||||
|
|
||||||
enum OpenEditorFlag {
|
enum OpenEditorFlag {
|
||||||
NoActivate = 1,
|
NoActivate = 1,
|
||||||
IgnoreNavigationHistory = 2
|
IgnoreNavigationHistory = 2,
|
||||||
|
NoModeSwitch = 4
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user