diff options
| author | JMC47 <JMC4789@gmail.com> | 2024-03-28 13:04:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 13:04:39 -0400 |
| commit | aea1f64873761c20a00be4acbc5767d8feb34a82 (patch) | |
| tree | c5271055c93ab3221e3c8ddf79657e1adfc59785 /Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | |
| parent | aa9601a563831b5079fb31f221ae1a3a0cd9e590 (diff) | |
| parent | ae5da02cde2328a696d3a3fe518b99cdc7f057d5 (diff) | |
Merge pull request #12659 from mitaclaw/qt-debug-font
DolphinQt Settings: Signal Debug Font By Const Reference
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index a7b097b93c..d841ca52af 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -172,9 +172,8 @@ CodeViewWidget::CodeViewWidget() connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu); connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged); - connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont); connect(&Settings::Instance(), &Settings::DebugFontChanged, this, - &CodeViewWidget::FontBasedSizing); + &CodeViewWidget::OnDebugFontChanged); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] { m_address = m_system.GetPPCState().pc; @@ -208,7 +207,7 @@ void CodeViewWidget::FontBasedSizing() // just text width is too small with some fonts, so increase by a bit constexpr int extra_text_width = 8; - const QFontMetrics fm(Settings::Instance().GetDebugFont()); + const QFontMetrics fm(font()); const int rowh = fm.height() + 1; verticalHeader()->setMaximumSectionSize(rowh); @@ -745,6 +744,12 @@ void CodeViewWidget::AutoStep(CodeTrace::AutoStop option) } while (msgbox.clickedButton() == (QAbstractButton*)run_button); } +void CodeViewWidget::OnDebugFontChanged(const QFont& font) +{ + setFont(font); + FontBasedSizing(); +} + void CodeViewWidget::OnCopyAddress() { const u32 addr = GetContextAddress(); |
