diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2023-04-25 00:12:59 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2023-04-25 12:34:34 -0700 |
| commit | bb227ad7bbf734a0efe29288e79f0d22654ee399 (patch) | |
| tree | d23342856835b71df1abea8d9122d327a8f57ef8 /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | 8c2e9242555bdcbaa0067658bf8a4a41d6936405 (diff) | |
DolphinQt: reset stylesheets on colorSchemeChanged
This is required for switching system color scheme
(dark/light) dynamically at runtime.
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index c1566fb795..3c295c9d74 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -14,6 +14,7 @@ #include <QIcon> #include <QMimeData> #include <QStackedWidget> +#include <QStyleHints> #include <QVBoxLayout> #include <QWindow> @@ -238,6 +239,13 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters, ConnectMenuBar(); ConnectHotkeys(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, + [](Qt::ColorScheme colorScheme) { + Settings::Instance().SetCurrentUserStyle(Settings::Instance().GetCurrentUserStyle()); + }); +#endif + connect(m_cheats_manager, &CheatsManager::OpenGeneralSettings, this, &MainWindow::ShowGeneralWindow); |
