Consistent behavior for mouse wheel: down goes forward, up goes backwards

BUG: 394341
parent 4ee96a0c
......@@ -242,9 +242,9 @@ void AnimKeyframeRuler::mouseReleaseEvent(QMouseEvent *event)
void AnimKeyframeRuler::wheelEvent(QWheelEvent *e)
{
if (e->delta() < 0) {
--m_position;
} else {
++m_position;
} else {
--m_position;
}
m_position = qMax(0, m_position);
m_position = qMin(frameLength, m_position);
......
......@@ -235,9 +235,9 @@ void KeyframeHelper::mouseReleaseEvent(QMouseEvent *event)
void KeyframeHelper::wheelEvent(QWheelEvent *e)
{
if (e->delta() < 0) {
--m_position;
} else {
++m_position;
} else {
--m_position;
}
m_position = qMax(0, m_position);
m_position = qMin(frameLength, m_position);
......
......@@ -956,21 +956,21 @@ void Monitor::slotMouseSeek(int eventDelta, int modifiers)
delta = 0 - delta;
}
if (render->requestedSeekPosition != SEEK_INACTIVE) {
slotSeek(render->requestedSeekPosition - delta);
slotSeek(render->requestedSeekPosition + delta);
} else {
slotSeek(render->seekFramePosition() - delta);
slotSeek(render->seekFramePosition() + delta);
}
} else if (modifiers & Qt::AltModifier) {
if (eventDelta >= 0) {
emit seekToNextSnap();
} else {
emit seekToPreviousSnap();
} else {
emit seekToNextSnap();
}
} else {
if (eventDelta >= 0) {
slotForwardOneFrame();
} else {
slotRewindOneFrame();
} else {
slotForwardOneFrame();
}
}
}
......
......@@ -263,7 +263,7 @@ void SimpleTimelineWidget::mouseDoubleClickEvent(QMouseEvent *event)
void SimpleTimelineWidget::wheelEvent(QWheelEvent *event)
{
int change = event->delta() < 0 ? -1 : 1;
int change = event->delta() < 0 ? 1 : -1;
/*if (m_currentKeyframe > 0) {
m_currentKeyframe = qBound(0, m_currentKeyframe + change, m_duration);
emit keyframeMoved(m_currentKeyframeOriginal, m_currentKeyframe);
......
......@@ -410,8 +410,8 @@ bool CustomTrackView::checkTrackHeight(bool force)
*
* If mousewheel+Ctrl, zooms in/out on the timeline.
*
* With Ctrl, moves viewport towards end of timeline if down/back,
* opposite on up/forward.
* With Alt, moves viewport towards end of timeline if down,
* opposite on up.
*
* See also http://www.kdenlive.org/mantis/view.php?id=265 */
void CustomTrackView::wheelEvent(QWheelEvent *e)
......@@ -427,9 +427,9 @@ void CustomTrackView::wheelEvent(QWheelEvent *e)
} else if (e->modifiers() == Qt::AltModifier) {
if (m_moveOpMode == None || m_moveOpMode == WaitingForConfirm || m_moveOpMode == ZoomTimeline) {
if (e->delta() > 0) {
slotSeekToNextSnap();
} else {
slotSeekToPreviousSnap();
} else {
slotSeekToNextSnap();
}
}
} else {
......@@ -4286,9 +4286,9 @@ void CustomTrackView::moveCursorPos(int delta)
{
int currentPos = m_document->renderer()->requestedSeekPosition;
if (currentPos == SEEK_INACTIVE) {
currentPos = m_document->renderer()->seekFramePosition() + delta;
currentPos = m_document->renderer()->seekFramePosition() - delta;
} else {
currentPos += delta;
currentPos -= delta;
}
emit updateRuler(currentPos);
m_document->renderer()->seek(qMax(0, currentPos));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment