Skip to content

Commit

Permalink
Debugger: Don't elide func names as much when func start is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and stenzek committed Oct 12, 2023
1 parent 03a7c74 commit 065f7d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pcsx2-qt/Debugger/DisassemblyWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void DisassemblyWidget::paintEvent(QPaintEvent* event)

// Row text
painter.setPen(GetAddressFunctionColor(rowAddress));
QString lineString = DisassemblyStringFromAddress(rowAddress, painter.font(), curPC);
QString lineString = DisassemblyStringFromAddress(rowAddress, painter.font(), curPC, rowAddress == m_selectedAddressStart);

painter.drawText(2, i * m_rowHeight, w, m_rowHeight, Qt::AlignLeft, lineString);
alternate = !alternate;
Expand Down Expand Up @@ -683,7 +683,7 @@ void DisassemblyWidget::customMenuRequested(QPoint pos)
contextMenu->popup(this->mapToGlobal(pos));
}

inline QString DisassemblyWidget::DisassemblyStringFromAddress(u32 address, QFont font, u32 pc)
inline QString DisassemblyWidget::DisassemblyStringFromAddress(u32 address, QFont font, u32 pc, bool selected)
{
DisassemblyLineInfo line;

Expand All @@ -708,7 +708,7 @@ inline QString DisassemblyWidget::DisassemblyStringFromAddress(u32 address, QFon
{
// We want this text elided
QFontMetrics metric(font);
lineString = lineString.arg(metric.elidedText(QString::fromStdString(addressSymbol), Qt::ElideRight, 8 * font.pointSize()));
lineString = lineString.arg(metric.elidedText(QString::fromStdString(addressSymbol), Qt::ElideRight, (selected ? 32 : 8) * font.pointSize()));
}

lineString = lineString.leftJustified(4, ' ') // Address / symbol
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Debugger/DisassemblyWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public slots:

DisassemblyManager m_disassemblyManager;

inline QString DisassemblyStringFromAddress(u32 address, QFont font, u32 pc);
inline QString DisassemblyStringFromAddress(u32 address, QFont font, u32 pc, bool selected);
QColor GetAddressFunctionColor(u32 address);
enum class SelectionInfo
{
Expand Down

0 comments on commit 065f7d6

Please sign in to comment.