diff options
| author | cristian64 <cristian64@gmail.com> | 2026-03-27 09:51:30 +0000 |
|---|---|---|
| committer | cristian64 <cristian64@gmail.com> | 2026-04-03 11:00:30 +0100 |
| commit | a37404a30421d152d2f78ee9d674d553ee395216 (patch) | |
| tree | 556fb28a470d85c791d844df4ecc2b1f1be881e1 /Source/Core | |
| parent | d3b89b4c39a312b52546c3604379b3f51ec3c876 (diff) | |
DolphinQt: Size adjustments in **Breakpoints** widget based on selected debug font.
- Debug font is now used in the widget.
- Row height is now determined by the character height of the current
font.
- A `OnDebugFontChanged()` slot has been connected to properly update
the widget on debug font changes.
| Before | After |
| --- | --- |
| <img alt="Breakpoints widget (before)" title="Breakpoints widget (before)" src="https://github.com/user-attachments/assets/fdde293a-b1fd-4a1d-85e2-e16bc859eb9e" /> | <img alt="Breakpoints widget (after)" title="Breakpoints widget (after)" src="https://github.com/user-attachments/assets/cf4f1d59-c235-429b-bcb1-cae36065e805" /> |
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | 11 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BreakpointWidget.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp index fbb5c38d9b..f3c7b6fb99 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp @@ -119,6 +119,8 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) }); connect(m_table, &QTableWidget::itemChanged, this, &BreakpointWidget::OnItemChanged); + connect(&Settings::Instance(), &Settings::DebugFontChanged, this, + &BreakpointWidget::OnDebugFontChanged); connect(&Settings::Instance(), &Settings::BreakpointsVisibilityChanged, this, [this](bool visible) { setHidden(!visible); }); @@ -160,6 +162,8 @@ void BreakpointWidget::CreateWidgets() m_table->setSelectionMode(QAbstractItemView::NoSelection); m_table->verticalHeader()->hide(); + OnDebugFontChanged(Settings::Instance().GetDebugFont()); + connect(m_table, &QTableWidget::itemClicked, this, &BreakpointWidget::OnClicked); connect(m_table, &QTableWidget::customContextMenuRequested, this, &BreakpointWidget::OnContextMenu); @@ -646,6 +650,13 @@ void BreakpointWidget::OnItemChanged(QTableWidgetItem* item) } } +void BreakpointWidget::OnDebugFontChanged(const QFont& font) +{ + m_table->setFont(font); + m_table->verticalHeader()->setDefaultSectionSize(m_table->fontMetrics().height()); + Update(); +} + void BreakpointWidget::AddBP(u32 addr) { AddBP(addr, true, true, {}); diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.h b/Source/Core/DolphinQt/Debugger/BreakpointWidget.h index 64dfcf1283..0341fdd50b 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.h +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.h @@ -65,6 +65,8 @@ private: void OnSave(); void OnContextMenu(const QPoint& pos); void OnItemChanged(QTableWidgetItem* item); + void OnDebugFontChanged(const QFont& font); + void UpdateIcons(); Core::System& m_system; |
