Fix DirectManipulation scroll events in media viewer.

This commit is contained in:
John Preston 2023-07-26 12:00:57 +04:00
parent 5dc35bc75f
commit 3654c197a9
2 changed files with 5 additions and 3 deletions

View File

@ -5065,20 +5065,22 @@ void OverlayWidget::handleKeyPress(not_null<QKeyEvent*> e) {
void OverlayWidget::handleWheelEvent(not_null<QWheelEvent*> e) {
constexpr auto step = int(QWheelEvent::DefaultDeltasPerStep);
const auto acceptForJump = (e->source() == Qt::MouseEventNotSynthesized)
|| (e->source() == Qt::MouseEventSynthesizedBySystem);
_verticalWheelDelta += e->angleDelta().y();
while (qAbs(_verticalWheelDelta) >= step) {
if (_verticalWheelDelta < 0) {
_verticalWheelDelta += step;
if (e->modifiers().testFlag(Qt::ControlModifier)) {
zoomOut();
} else if (e->source() == Qt::MouseEventNotSynthesized) {
} else if (acceptForJump) {
moveToNext(1);
}
} else {
_verticalWheelDelta -= step;
if (e->modifiers().testFlag(Qt::ControlModifier)) {
zoomIn();
} else if (e->source() == Qt::MouseEventNotSynthesized) {
} else if (acceptForJump) {
moveToNext(-1);
}
}

@ -1 +1 @@
Subproject commit 2f0ac382289d0584002c007bdf2b3e4464f75b58
Subproject commit 91d43ea4b50ef1e7df810ab1f14c49e044570734