implemented inverted timeline scroll axes
Timeline scrolls horizontally by default with a preference to disable that functionality.
This commit is contained in:
@@ -69,13 +69,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, QMenuBar* main_menu_bar) :
|
||||
|
||||
connect(list_widget_, SIGNAL(currentRowChanged(int)), preference_pane_stack_, SLOT(setCurrentIndex(int)));
|
||||
|
||||
// set up default sequence
|
||||
/*default_sequence.set_name(tr("Default Sequence"));
|
||||
default_sequence.set_width(olive::config.default_sequence_width);
|
||||
default_sequence.set_height(olive::config.default_sequence_height);
|
||||
default_sequence.set_frame_rate(olive::config.default_sequence_framerate);
|
||||
default_sequence.set_audio_frequency(olive::config.default_sequence_audio_frequency);
|
||||
default_sequence.set_audio_layout(olive::config.default_sequence_audio_channel_layout);*/
|
||||
}
|
||||
|
||||
void PreferencesDialog::AddBoolPair(QCheckBox *ui, bool *value, bool restart_required)
|
||||
|
||||
@@ -45,6 +45,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab()
|
||||
timeline_group);
|
||||
AddItem(tr("Invert Timeline Scroll Axes"),
|
||||
QStringLiteral("InvertTimelineScrollAxes"),
|
||||
tr("Hold ALT on any UI element to switch scrolling axes"),
|
||||
timeline_group);
|
||||
AddItem(tr("Seek Also Selects"),
|
||||
QStringLiteral("SelectAlsoSeeks"),
|
||||
|
||||
@@ -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()),
|
||||
|
||||
@@ -78,6 +78,8 @@ protected:
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
|
||||
virtual void wheelEvent(QWheelEvent* event) override;
|
||||
|
||||
virtual void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
virtual void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
virtual void dragLeaveEvent(QDragLeaveEvent *event) override;
|
||||
|
||||
Reference in New Issue
Block a user