forked from qt-creator/qt-creator
MinimizableInfoBars: Move toolbar visibility handling
Remove some coupling between CppEditorWidget and MinimizableInfoBars by handing the visibility of the toolbar buttons solely within MinimizableInfoBars. Change-Id: I5abf59187ea9b37fd13c91d63b2c82a1caa67275 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -46,25 +46,24 @@ class MinimizableInfoBars : public QObject
|
||||
|
||||
public:
|
||||
using ActionCreator = std::function<QAction *(QWidget *widget)>;
|
||||
using Actions = QHash<Utils::Id, QAction *>;
|
||||
|
||||
static Actions createShowInfoBarActions(const ActionCreator &actionCreator);
|
||||
|
||||
public:
|
||||
explicit MinimizableInfoBars(Utils::InfoBar &infoBar, QObject *parent = nullptr);
|
||||
|
||||
void createShowInfoBarActions(const ActionCreator &actionCreator) const;
|
||||
|
||||
void processHasProjectPart(bool hasProjectPart);
|
||||
|
||||
signals:
|
||||
void showAction(const Utils::Id &id, bool show);
|
||||
|
||||
private:
|
||||
void createActions();
|
||||
|
||||
void updateNoProjectConfiguration();
|
||||
|
||||
void addNoProjectConfigurationEntry(const Utils::Id &id);
|
||||
|
||||
private:
|
||||
Utils::InfoBar &m_infoBar;
|
||||
QHash<Utils::Id, QAction *> m_actions;
|
||||
|
||||
bool m_hasProjectPart = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user