forked from qt-creator/qt-creator
Move MinimizableInfoBars from CppEditorDocument to IDocument
Similar to the InfoBar. The only thing that an editor implementation needs to do is to set a settings group and the possible info bars in the document constructor. And later call document->minimizableInfoBars()->setInfoVisible(id, visible) to manage the state. Change-Id: I23afb3639b70b1bfccd424579da018280a7fe2cb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/infobar.h>
|
||||
#include <utils/mimeutils.h>
|
||||
#include <utils/minimizableinfobars.h>
|
||||
#include <utils/multitextcursor.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/styledbar.h>
|
||||
@@ -8534,6 +8535,12 @@ BaseTextEditor *TextEditorFactoryPrivate::createEditorHelper(const TextDocumentP
|
||||
if (m_useGenericHighlighter)
|
||||
textEditorWidget->setupGenericHighlighter();
|
||||
textEditorWidget->finalizeInitialization();
|
||||
|
||||
// Toolbar: Actions to show minimized info bars
|
||||
document->minimizableInfoBars()->createShowInfoBarActions([textEditorWidget](QWidget *w) {
|
||||
return textEditorWidget->insertExtraToolBarWidget(TextEditorWidget::Left, w);
|
||||
});
|
||||
|
||||
editor->finalizeInitialization();
|
||||
return editor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user