mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +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)
|
void GraphView::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
|
// for scrolling with arrow keys
|
||||||
const int delta = static_cast<int>(30.0 / current_scale);
|
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;
|
int dx = 0, dy = 0;
|
||||||
switch (event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
@ -718,6 +721,12 @@ void GraphView::keyPressEvent(QKeyEvent *event)
|
|||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
dx = delta;
|
dx = delta;
|
||||||
break;
|
break;
|
||||||
|
case Qt::Key_PageUp:
|
||||||
|
dy = -delta2;
|
||||||
|
break;
|
||||||
|
case Qt::Key_PageDown:
|
||||||
|
dy = delta2;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
QAbstractScrollArea::keyPressEvent(event);
|
QAbstractScrollArea::keyPressEvent(event);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user