DolphinQt/Settings: Split setting of the user style into two functions.

This makes it so that if you just want to reload the current style (eg. on program start, or in response to a system event), you don't need to know the name of the currently selected user style. It's also more consistent with the way the 'userstyle/enabled' flag works.
This commit is contained in:
Admiral H. Curtiss
2023-11-04 17:56:43 +01:00
parent 9d08c8a45d
commit 6d585b6eb6
6 changed files with 20 additions and 14 deletions

View File

@ -240,9 +240,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[](Qt::ColorScheme colorScheme) {
Settings::Instance().SetCurrentUserStyle(Settings::Instance().GetCurrentUserStyle());
});
[](Qt::ColorScheme colorScheme) { Settings::Instance().ApplyStyle(); });
#endif
connect(m_cheats_manager, &CheatsManager::OpenGeneralSettings, this,
@ -1739,7 +1737,7 @@ bool MainWindow::nativeEvent(const QByteArray& eventType, void* message, qintptr
settings.UpdateSystemDark();
if (settings.IsSystemDark() != was_dark_before)
{
settings.SetCurrentUserStyle(settings.GetCurrentUserStyle());
settings.ApplyStyle();
// force the colors in the Skylander window to update
if (m_skylander_window)