mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Intercept right-click event in the decompiler widget (#2281)
Update cursor before opening context menu for right-click
This commit is contained in:
parent
8b4c58e07d
commit
88f837465f
@ -435,13 +435,18 @@ bool DecompilerWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
if (event->type() == QEvent::MouseButtonDblClick
|
||||
&& (obj == ui->textEdit || obj == ui->textEdit->viewport())) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
|
||||
const QTextCursor &cursor = ui->textEdit->cursorForPosition(QPoint(mouseEvent->x(),
|
||||
mouseEvent->y()));
|
||||
ui->textEdit->setTextCursor(ui->textEdit->cursorForPosition(mouseEvent->pos()));
|
||||
seekToReference();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::MouseButtonPress
|
||||
&& (obj == ui->textEdit || obj == ui->textEdit->viewport())) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::RightButton) {
|
||||
ui->textEdit->setTextCursor(ui->textEdit->cursorForPosition(mouseEvent->pos()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return MemoryDockWidget::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user