From bc7b0e53f0283da1d1548f0dab425e9833d5aeff Mon Sep 17 00:00:00 2001 From: Dan McCarthy Date: Tue, 30 Jan 2024 21:53:16 -0600 Subject: [PATCH] Debugger: Adds editing register values via double click Double clicking a register segment will open the segment edit dialogue that normally has to be accessed by the right click menu. --- pcsx2-qt/Debugger/RegisterWidget.cpp | 13 +++++++++++++ pcsx2-qt/Debugger/RegisterWidget.h | 1 + 2 files changed, 14 insertions(+) diff --git a/pcsx2-qt/Debugger/RegisterWidget.cpp b/pcsx2-qt/Debugger/RegisterWidget.cpp index cf859d122d..3ac38bebd2 100644 --- a/pcsx2-qt/Debugger/RegisterWidget.cpp +++ b/pcsx2-qt/Debugger/RegisterWidget.cpp @@ -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()) diff --git a/pcsx2-qt/Debugger/RegisterWidget.h b/pcsx2-qt/Debugger/RegisterWidget.h index 59cbc23673..a12ba0cea7 100644 --- a/pcsx2-qt/Debugger/RegisterWidget.h +++ b/pcsx2-qt/Debugger/RegisterWidget.h @@ -26,6 +26,7 @@ public: protected: void paintEvent(QPaintEvent* event); void mousePressEvent(QMouseEvent* event); + void mouseDoubleClickEvent(QMouseEvent* event); void wheelEvent(QWheelEvent* event); public slots: