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/Debugger/CodeViewWidget.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/Debugger/CodeViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <QPainter> #include <QResizeEvent> #include <QScrollBar> +#include <QStyleHints> #include <QStyledItemDelegate> #include <QTableWidgetItem> #include <QWheelEvent> @@ -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); |
