Skip to content

Commit

Permalink
Merge pull request #1978 from Wallacoloo/pianorollfocus
Browse files Browse the repository at this point in the history
Give focus to the PianoRoll widget when its window is opened
  • Loading branch information
tresf committed Apr 19, 2015
2 parents f9e37f7 + 382aec6 commit d610759
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/PianoRoll.h
Expand Up @@ -384,6 +384,8 @@ class PianoRollWindow : public Editor, SerializingObject
void currentPatternChanged();

private:
void focusInEvent(QFocusEvent * event);

PianoRoll* m_editor;

ComboBox * m_zoomingComboBox;
Expand Down
6 changes: 6 additions & 0 deletions src/gui/editors/PianoRoll.cpp
Expand Up @@ -4236,3 +4236,9 @@ QSize PianoRollWindow::sizeHint() const
{
return {m_toolBar->sizeHint().width() + 10, INITIAL_PIANOROLL_HEIGHT};
}

void PianoRollWindow::focusInEvent(QFocusEvent * event)
{
// when the window is given focus, also give focus to the actual piano roll
m_editor->setFocus(event->reason());
}

0 comments on commit d610759

Please sign in to comment.