[TD]fix keyboard zoomIn/zoomOut for Touchpad mode

This commit is contained in:
wandererfan
2023-08-30 19:32:49 -04:00
committed by WandererFan
parent 0a8382a844
commit 61add5ea7a
3 changed files with 36 additions and 14 deletions

View File

@@ -48,16 +48,18 @@ void QGVNavStyleTouchpad::handleKeyPressEvent(QKeyEvent *event)
{
// Q_UNUSED(event)
if (event->key() == Qt::Key_PageUp) {
zoom(1.0 + zoomStep);
zoomIn();
event->accept();
return;
}
if (event->key() == Qt::Key_PageDown) {
zoom(1.0 - zoomStep);
zoomOut();
event->accept();
return;
}
QGVNavStyle::handleKeyPressEvent(event);
}
void QGVNavStyleTouchpad::handleKeyReleaseEvent(QKeyEvent *event)
@@ -94,6 +96,7 @@ void QGVNavStyleTouchpad::handleMouseMoveEvent(QMouseEvent *event)
startPan(event->pos());
}
event->accept();
return;
}
if (QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier) &&
@@ -105,7 +108,13 @@ void QGVNavStyleTouchpad::handleMouseMoveEvent(QMouseEvent *event)
startZoom(event->pos());
}
event->accept();
return;
}
// if the mouse moves, but we are not zooming or panning, then we should make
// sure that zoom and pan are turned off.
stopPan();
stopZoom();
}
void QGVNavStyleTouchpad::setAnchor()