Skip to content

Commit

Permalink
debugger(CallStack): Make Return act as double click
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 authored and Nekotekina committed Jun 5, 2023
1 parent 0c0f63a commit e75c0db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions rpcs3/rpcs3qt/call_stack_list.cpp
Expand Up @@ -13,7 +13,7 @@ call_stack_list::call_stack_list(QWidget* parent) : QListWidget(parent)
setSelectionMode(QAbstractItemView::ExtendedSelection);

// connects
connect(this, &QListWidget::itemDoubleClicked, this, &call_stack_list::OnCallStackListDoubleClicked);
connect(this, &QListWidget::itemDoubleClicked, this, &call_stack_list::ShowItemAddress);

// Hide until used in order to allow as much space for registers panel as possible
hide();
Expand All @@ -23,6 +23,11 @@ void call_stack_list::keyPressEvent(QKeyEvent* event)
{
QListWidget::keyPressEvent(event);
event->ignore(); // Propagate the event to debugger_frame

if (!event->modifiers() && event->key() == Qt::Key_Return)
{
ShowItemAddress();
}
}

void call_stack_list::HandleUpdate(const std::vector<std::pair<u32, u32>>& call_stack)
Expand All @@ -40,7 +45,7 @@ void call_stack_list::HandleUpdate(const std::vector<std::pair<u32, u32>>& call_
setVisible(!call_stack.empty());
}

void call_stack_list::OnCallStackListDoubleClicked()
void call_stack_list::ShowItemAddress()
{
if (QListWidgetItem* call_stack_item = currentItem())
{
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/call_stack_list.h
Expand Up @@ -20,7 +20,7 @@ class call_stack_list : public QListWidget
public Q_SLOTS:
void HandleUpdate(const std::vector<std::pair<u32, u32>>& call_stack);
private Q_SLOTS:
void OnCallStackListDoubleClicked();
void ShowItemAddress();
private:
void keyPressEvent(QKeyEvent* event) override;
};

0 comments on commit e75c0db

Please sign in to comment.