mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 14:19:02 +00:00
DolphinQt: reset stylesheets on colorSchemeChanged
This is required for switching system color scheme (dark/light) dynamically at runtime.
This commit is contained in:
parent
8c2e924255
commit
bb227ad7bb
4 changed files with 42 additions and 6 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue