]> git.sesse.net Git - kdenlive/commitdiff
Hopefully trivial fix for issue 0000265: mousewheel scroll direction in timeline...
authorMads Bondo Dydensborg <mads@dydensborg.dk>
Sat, 25 Oct 2008 11:51:12 +0000 (11:51 +0000)
committerMads Bondo Dydensborg <mads@dydensborg.dk>
Sat, 25 Oct 2008 11:51:12 +0000 (11:51 +0000)
svn path=/branches/KDE4/; revision=2559

src/customtrackview.cpp
src/monitor.cpp

index 56c1c3a1d8637d002651106eb3661b3139fe14c3..7eb71e984c7c95148fd8a7d99586868a0bcace87 100644 (file)
@@ -157,12 +157,20 @@ void CustomTrackView::resizeEvent(QResizeEvent * event) {
 }
 
 // virtual
+/** Zoom or move viewport on mousewheel
+ *
+ * If mousewheel+Ctrl, zooms in/out on the timeline.
+ *
+ * With Ctrl, moves viewport towards end of timeline if down/back,
+ * opposite on up/forward.
+ *
+ * See also http://www.kdenlive.org/mantis/view.php?id=265 */
 void CustomTrackView::wheelEvent(QWheelEvent * e) {
     if (e->modifiers() == Qt::ControlModifier) {
         if (e->delta() > 0) emit zoomIn();
         else emit zoomOut();
     } else {
-        if (e->delta() > 0) horizontalScrollBar()->setValue(horizontalScrollBar()->value() + horizontalScrollBar()->singleStep());
+        if (e->delta() <= 0) horizontalScrollBar()->setValue(horizontalScrollBar()->value() + horizontalScrollBar()->singleStep());
         else  horizontalScrollBar()->setValue(horizontalScrollBar()->value() - horizontalScrollBar()->singleStep());
     }
 }
index 2b1102784169660d7d96afa777e549d5cbd5000d..9ad543b5f2a1a67ff2dabfb96678d352e1cd00fa 100644 (file)
@@ -293,13 +293,21 @@ QStringList Monitor::mimeTypes() const {
 
 
 // virtual
+/** Move to other position on mousewheel
+ *
+ * Moves towards end of clip/timeline on mousewheel down/back,
+ * opposite for mousewheel up/forward.
+ *
+ * Ctrl+wheel moves single frame, without Ctrl moves a second.
+ *
+ * See also http://www.kdenlive.org/mantis/view.php?id=265 */
 void Monitor::wheelEvent(QWheelEvent * event) {
     if (event->modifiers() == Qt::ControlModifier) {
         int delta = m_monitorManager->timecode().fps();
         if (event->delta() < 0) delta = 0 - delta;
-        slotSeek(m_position + delta);
+        slotSeek(m_position - delta);
     } else {
-        if (event->delta() > 0) slotForwardOneFrame();
+        if (event->delta() <= 0) slotForwardOneFrame();
         else slotRewindOneFrame();
     }
 }