Piano roll: reset editing mode when lost focus (#4393)

This commit is contained in:
Hyunjin Song
2018-06-05 17:39:04 +09:00
committed by GitHub
parent 3bf3fab0e3
commit 2f19fa11c8

View File

@@ -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 ),
@@ -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();
}
@@ -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;
}