Gui: Enable Overlay only for new users

This change tries to detect invalid state where overlay was
half-initialized that resulted in overlay being enabled for more users
that we initially aimed for.
This commit is contained in:
Kacper Donat
2025-11-10 16:28:13 +01:00
parent 3071cc847c
commit f43c6906ff

View File

@@ -755,10 +755,19 @@ void OverlayTabWidget::restore(ParameterGrp::handle handle)
hGrp = handle;
return;
}
if (!parentWidget())
return;
std::string widgets = handle->GetASCII("Widgets", getDockArea() == Qt::RightDockWidgetArea ? "Tasks," : "");
if (!parentWidget()) {
return;
}
const char* defaultWidgets = "";
// If overlay was ever used and disabled by the user it should respect that choice
if (handle->GetInt("Width", 0) == 0 || handle->GetInt("Height", 0) == 0) {
defaultWidgets = getDockArea() == Qt::RightDockWidgetArea ? "Tasks," : "";
}
std::string widgets = handle->GetASCII("Widgets", defaultWidgets);
for(auto &name : QString::fromUtf8(widgets.c_str()).split(QLatin1Char(','))) {
if(name.isEmpty())