mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DolphinQt: reset stylesheets on colorSchemeChanged
This is required for switching system color scheme (dark/light) dynamically at runtime.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user