mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Support graph and disassembly scrolling via PgUp and PgDown
This commit is contained in:
parent
3921ba172e
commit
5144c3f3b5
@ -703,7 +703,10 @@ void GraphView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
void GraphView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
// for scrolling with arrow keys
|
||||
const int delta = static_cast<int>(30.0 / current_scale);
|
||||
// for scrolling with pgup/pgdown keys
|
||||
const int delta2 = static_cast<int>(100.0 / current_scale);
|
||||
int dx = 0, dy = 0;
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Up:
|
||||
@ -718,6 +721,12 @@ void GraphView::keyPressEvent(QKeyEvent *event)
|
||||
case Qt::Key_Right:
|
||||
dx = delta;
|
||||
break;
|
||||
case Qt::Key_PageUp:
|
||||
dy = -delta2;
|
||||
break;
|
||||
case Qt::Key_PageDown:
|
||||
dy = delta2;
|
||||
break;
|
||||
default:
|
||||
QAbstractScrollArea::keyPressEvent(event);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user