forked from qt-creator/qt-creator
ADS: Hide detached window if not in design mode
Task-number: QDS-1672 Change-Id: Ia20113cb9025c19194d87920cf060d2b9791e52a Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
6de4e49646
commit
73aaa2a381
@@ -42,6 +42,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager_p.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <qmldesigner/qmldesignerconstants.h>
|
||||
|
||||
#include <coreplugin/outputpane.h>
|
||||
@@ -381,6 +382,23 @@ void DesignModeWidget::setup()
|
||||
setupNavigatorHistory(currentDesignDocument()->textEditor());
|
||||
|
||||
m_dockManager->initialize();
|
||||
|
||||
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged,
|
||||
this, [this](Core::Id mode, Core::Id oldMode) {
|
||||
if (mode == Core::Constants::MODE_DESIGN) {
|
||||
m_dockManager->reloadActiveWorkspace();
|
||||
m_dockManager->setModeChangeState(false);
|
||||
}
|
||||
|
||||
if (oldMode == Core::Constants::MODE_DESIGN
|
||||
&& mode != Core::Constants::MODE_DESIGN) {
|
||||
m_dockManager->save();
|
||||
m_dockManager->setModeChangeState(true);
|
||||
for (auto floatingWidget : m_dockManager->floatingWidgets())
|
||||
floatingWidget->hide();
|
||||
}
|
||||
});
|
||||
|
||||
viewManager().enableWidgets();
|
||||
readSettings();
|
||||
show();
|
||||
|
||||
Reference in New Issue
Block a user