implemented inverted timeline scroll axes

Timeline scrolls horizontally by default with a preference to disable that
functionality.
This commit is contained in:
itsmattkc
2019-12-31 18:46:42 +11:00
parent 9060636499
commit c2558b3d06
4 changed files with 19 additions and 7 deletions
@@ -27,6 +27,7 @@
#include <QtMath>
#include <QPen>
#include "config/config.h"
#include "common/flipmodifiers.h"
#include "common/timecodefunctions.h"
#include "core.h"
@@ -113,6 +114,21 @@ void TimelineView::mouseDoubleClickEvent(QMouseEvent *event)
emit MouseDoubleClicked(&timeline_event);
}
void TimelineView::wheelEvent(QWheelEvent *event)
{
if (Config::Current()["InvertTimelineScrollAxes"].toBool()) {
QWheelEvent e(event->pos(),
event->delta(),
event->buttons(),
event->modifiers(),
event->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
QGraphicsView::wheelEvent(&e);
} else {
QGraphicsView::wheelEvent(event);
}
}
void TimelineView::dragEnterEvent(QDragEnterEvent *event)
{
TimelineViewMouseEvent timeline_event(ScreenToCoordinate(event->pos()),