From bb227ad7bbf734a0efe29288e79f0d22654ee399 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Tue, 25 Apr 2023 00:12:59 -0700 Subject: DolphinQt: reset stylesheets on colorSchemeChanged This is required for switching system color scheme (dark/light) dynamically at runtime. --- Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp') diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index edac049a96..cd93541736 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -161,6 +162,11 @@ CodeViewWidget::CodeViewWidget() : m_system(Core::System::GetInstance()) FontBasedSizing(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, + [this](Qt::ColorScheme colorScheme) { OnSelectionChanged(); }); +#endif + connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu); connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged); connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont); -- cgit v1.2.3