Gui: Change QStyle only with theme

It fiexes performance issues on applying preferences that happens due to
forcing Qt style which is quite slow operation.
This commit is contained in:
Kacper Donat
2024-06-20 22:54:23 +02:00
committed by Chris Hennes
parent 5e47f6804f
commit acacdea43b

View File

@@ -251,16 +251,17 @@ void DlgSettingsGeneral::saveSettings()
int blinkTime{hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0};
qApp->setCursorFlashTime(blinkTime);
std::string qtStyle = hGrp->GetASCII("QtStyle");
qApp->setStyle(QString::fromStdString(qtStyle));
saveDockWindowVisibility();
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow");
hGrp->SetBool("TiledBackground", ui->tiledBackground->isChecked());
if (themeChanged)
if (themeChanged) {
auto qtStyle = QString::fromStdString(hGrp->GetASCII("QtStyle"));
saveThemes();
qApp->setStyle(qtStyle);
}
}
void DlgSettingsGeneral::loadSettings()