diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 2e77a7483..5fc3ca03a 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -239,6 +239,7 @@ private: EditModes m_editMode; + bool m_mouseDownRight; //true if right click is being held down TimeLineWidget * m_timeLine; bool m_scrollBack; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 43400cbf3..9167804ae 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -358,7 +358,6 @@ private: EditModes m_editMode; EditModes m_ctrlMode; // mode they were in before they hit ctrl - bool m_mouseDownLeft; //true if left click is being held down bool m_mouseDownRight; //true if right click is being held down TimeLineWidget * m_timeLine; diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index a6f7d16de..a04378281 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -103,6 +103,7 @@ AutomationEditor::AutomationEditor() : m_y_delta( DEFAULT_Y_DELTA ), m_y_auto( true ), m_editMode( DRAW ), + m_mouseDownRight( false ), m_scrollBack( false ), m_barLineColor( 0, 0, 0 ), m_beatLineColor( 0, 0, 0 ), @@ -539,6 +540,11 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) ++it; } + if( mouseEvent->button() == Qt::RightButton ) + { + m_mouseDownRight = true; + } + // left button?? if( mouseEvent->button() == Qt::LeftButton && m_editMode == DRAW ) @@ -649,6 +655,19 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) void AutomationEditor::mouseReleaseEvent(QMouseEvent * mouseEvent ) { + bool mustRepaint = false; + + if ( mouseEvent->button() == Qt::RightButton ) + { + m_mouseDownRight = false; + mustRepaint = true; + } + + if( mouseEvent->button() == Qt::LeftButton ) + { + mustRepaint = true; + } + if( m_editMode == DRAW ) { if( m_action == MOVE_VALUE ) @@ -659,6 +678,11 @@ void AutomationEditor::mouseReleaseEvent(QMouseEvent * mouseEvent ) } m_action = NONE; + + if( mustRepaint ) + { + repaint(); + } } @@ -1433,7 +1457,21 @@ void AutomationEditor::paintEvent(QPaintEvent * pe ) // draw current edit-mode-icon below the cursor switch( m_editMode ) { - case DRAW: cursor = s_toolDraw; break; + case DRAW: + if( m_mouseDownRight ) + { + cursor = s_toolErase; + } + else if( m_action == MOVE_VALUE ) + { + cursor = s_toolMove; + } + else + { + cursor = s_toolDraw; + } + + break; case ERASE: cursor = s_toolErase; break; case SELECT: cursor = s_toolSelect; break; case MOVE: cursor = s_toolMove; break; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 73fa1ebe0..31bfcc936 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -186,7 +186,6 @@ PianoRoll::PianoRoll() : m_startKey( INITIAL_START_KEY ), m_lastKey( 0 ), m_editMode( ModeDraw ), - m_mouseDownLeft( false ), m_mouseDownRight( false ), m_scrollBack( false ), m_barLineColor( 0, 0, 0 ), @@ -1922,7 +1921,6 @@ void PianoRoll::mouseReleaseEvent( QMouseEvent * me ) if( me->button() & Qt::LeftButton ) { - m_mouseDownLeft = false; mustRepaint = true; if( m_action == ActionSelectNotes && m_editMode == ModeSelect )