mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-12 21:31:39 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue