Skip to content

Commit

Permalink
Piano roll: reset editing mode when lost focus (#4393)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong authored Jun 5, 2018
1 parent 3bf3fab commit 2f19fa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ PianoRoll::PianoRoll() :
m_startKey( INITIAL_START_KEY ),
m_lastKey( 0 ),
m_editMode( ModeDraw ),
m_ctrlMode( ModeDraw ),
m_mouseDownRight( false ),
m_scrollBack( false ),
m_barLineColor( 0, 0, 0 ),
Expand Down Expand Up @@ -3343,8 +3344,9 @@ void PianoRoll::focusOutEvent( QFocusEvent * )
m_pattern->instrumentTrack()->pianoModel()->midiEventProcessor()->processInEvent( MidiEvent( MidiNoteOff, -1, i, 0 ) );
m_pattern->instrumentTrack()->pianoModel()->setKeyState( i, false );
}
update();
}
m_editMode = m_ctrlMode;
update();
}


Expand Down Expand Up @@ -3552,7 +3554,7 @@ void PianoRoll::verScrolled( int new_pos )

void PianoRoll::setEditMode(int mode)
{
m_editMode = (EditModes) mode;
m_ctrlMode = m_editMode = (EditModes) mode;
}


Expand Down

0 comments on commit 2f19fa1

Please sign in to comment.