Skip to content

Commit

Permalink
Debugger: Adds editing register values via double click
Browse files Browse the repository at this point in the history
Double clicking a register segment will open the segment edit dialogue that normally has to be accessed by the right click menu.
  • Loading branch information
Daniel-McCarthy authored and refractionpcsx2 committed Jan 31, 2024
1 parent 3695862 commit bc7b0e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pcsx2-qt/Debugger/RegisterWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ void RegisterWidget::wheelEvent(QWheelEvent* event)
this->repaint();
}

void RegisterWidget::mouseDoubleClickEvent(QMouseEvent* event)
{
if (!m_cpu->isAlive())
return;
if (m_selectedRow > m_rowEnd) // Unsigned underflow; selectedRow will be > m_rowEnd (technically negative)
return;
const int categoryIndex = ui.registerTabs->currentIndex();
if (m_cpu->getRegisterSize(categoryIndex) == 128)
contextChangeSegment();
else
contextChangeValue();
}

void RegisterWidget::customMenuRequested(QPoint pos)
{
if (!m_cpu->isAlive())
Expand Down
1 change: 1 addition & 0 deletions pcsx2-qt/Debugger/RegisterWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class RegisterWidget final : public QWidget
protected:
void paintEvent(QPaintEvent* event);
void mousePressEvent(QMouseEvent* event);
void mouseDoubleClickEvent(QMouseEvent* event);
void wheelEvent(QWheelEvent* event);

public slots:
Expand Down

0 comments on commit bc7b0e5

Please sign in to comment.