Immediately close all of Insight's child windows on InsightWindow::deactivate()

This commit is contained in:
Nav
2022-08-13 18:42:40 +01:00
parent b0b167453d
commit a0ee539501
2 changed files with 12 additions and 4 deletions

View File

@@ -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");

View File

@@ -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<QWidget*>();
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() {