Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ protected slots:
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;

void adjustLeftRightScoll(int value);

TimePos m_currentPosition;

Action m_action;
Expand Down
2 changes: 2 additions & 0 deletions include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ protected slots:
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;

void adjustLeftRightScoll(int value);

TimePos m_currentPosition;
bool m_recording;
bool m_doAutoQuantization{false};
Expand Down
2 changes: 2 additions & 0 deletions include/SongEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ private slots:

QScrollBar * m_leftRightScroll;

void adjustLeftRightScoll(int value);

LcdSpinBox * m_tempoSpinBox;

TimeLineWidget * m_timeLine;
Expand Down
12 changes: 7 additions & 5 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,11 @@ void AutomationEditor::resizeEvent(QResizeEvent * re)
update();
}


void AutomationEditor::adjustLeftRightScoll(int value)
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
value * 0.3f / m_zoomXLevels[m_zoomingXModel.value()]);
}


// TODO: Move this method up so it's closer to the other mouse events
Expand Down Expand Up @@ -1625,13 +1629,11 @@ void AutomationEditor::wheelEvent(QWheelEvent * we )
// FIXME: Reconsider if determining orientation is necessary in Qt6.
else if(abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
we->angleDelta().x() * 2 / 15);
adjustLeftRightScoll(we->angleDelta().x());
}
else if(we->modifiers() & Qt::ShiftModifier)
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
we->angleDelta().y() * 2 / 15);
adjustLeftRightScoll(we->angleDelta().y());
}
else
{
Expand Down
12 changes: 8 additions & 4 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,12 @@ void PianoRoll::resizeEvent(QResizeEvent* re)
}


void PianoRoll::adjustLeftRightScoll(int value)
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
value * 0.3f / m_zoomLevels[m_zoomingModel.value()]);
}



void PianoRoll::wheelEvent(QWheelEvent * we )
Expand Down Expand Up @@ -3875,13 +3881,11 @@ void PianoRoll::wheelEvent(QWheelEvent * we )
// FIXME: Reconsider if determining orientation is necessary in Qt6.
else if(abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
we->angleDelta().x() * 2 / 15);
adjustLeftRightScoll(we->angleDelta().x());
}
else if(we->modifiers() & Qt::ShiftModifier)
{
m_leftRightScroll->setValue(m_leftRightScroll->value() -
we->angleDelta().y() * 2 / 15);
adjustLeftRightScoll(we->angleDelta().y());
}
else
{
Expand Down
12 changes: 8 additions & 4 deletions src/gui/editors/SongEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@ void SongEditor::keyPressEvent( QKeyEvent * ke )



void SongEditor::adjustLeftRightScoll(int value)
{
m_leftRightScroll->setValue(m_leftRightScroll->value()
- value * DEFAULT_PIXELS_PER_BAR / pixelsPerBar());
}


void SongEditor::wheelEvent( QWheelEvent * we )
{
Expand Down Expand Up @@ -544,13 +550,11 @@ void SongEditor::wheelEvent( QWheelEvent * we )
// FIXME: Reconsider if determining orientation is necessary in Qt6.
else if (std::abs(we->angleDelta().x()) > std::abs(we->angleDelta().y())) // scrolling is horizontal
{
m_leftRightScroll->setValue(m_leftRightScroll->value()
- we->angleDelta().x());
adjustLeftRightScoll(we->angleDelta().x());
}
else if (we->modifiers() & Qt::ShiftModifier)
{
m_leftRightScroll->setValue(m_leftRightScroll->value()
- we->angleDelta().y());
adjustLeftRightScoll(we->angleDelta().y());
}
else
{
Expand Down