diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index 6a87a534..7cae516d 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -172,9 +172,8 @@ namespace Bloom } Logger::info("Shutting down Insight"); - if (this->mainWindow->isVisible()) { - this->mainWindow->close(); - } + + this->mainWindow->close(); if (this->workerThread != nullptr && this->workerThread->isRunning()) { Logger::debug("Stopping InsightWorker thread"); diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index 912e29cb..6b3990c2 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -303,6 +303,7 @@ namespace Bloom } void InsightWindow::closeEvent(QCloseEvent* event) { + this->deactivate(); return QMainWindow::closeEvent(event); } @@ -714,7 +715,14 @@ namespace Bloom } void InsightWindow::deactivate() { - this->recordInsightSettings(); + const auto insightProjectSettings = this->insightProjectSettings; + const auto childWidgets = this->findChildren(); + + for (auto* widget : childWidgets) { + if (widget->windowFlags() & Qt::Window) { + widget->close(); + } + } if (this->selectedVariant != nullptr) { this->previouslySelectedVariant = *(this->selectedVariant); @@ -746,6 +754,7 @@ namespace Bloom this->setUiDisabled(true); this->activated = false; + this->insightProjectSettings = insightProjectSettings; } void InsightWindow::adjustPanels() {