Skip to content

Commit

Permalink
Merge pull request #3885 from jthistle/275479-master-palette-doesnt-c…
Browse files Browse the repository at this point in the history
…lose-on-esc-linux

Fix #275479: Master palette doesn't close on ESC
  • Loading branch information
anatoly-os committed Aug 24, 2018
2 parents 8bdb7cd + 3e79402 commit ad78d4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mscore/masterpalette.cpp
Expand Up @@ -95,6 +95,19 @@ Palette* MasterPalette::createPalette(int w, int h, bool grid, double mag)
return sp;
}

//---------------------------------------------------------
// keyPressEvent
//---------------------------------------------------------

void MasterPalette::keyPressEvent(QKeyEvent* ev)
{
if (ev->key() == Qt::Key_Escape && ev->modifiers() == Qt::NoModifier) {
close();
return;
}
QWidget::keyPressEvent(ev);
}

//---------------------------------------------------------
// selectItem
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions mscore/masterpalette.h
Expand Up @@ -50,6 +50,7 @@ class MasterPalette : public QWidget, Ui::MasterPalette
protected:
virtual void changeEvent(QEvent *event);
void retranslate(bool firstTime = false);
virtual void keyPressEvent(QKeyEvent *ev);

public:
MasterPalette(QWidget* parent = 0);
Expand Down

0 comments on commit ad78d4e

Please sign in to comment.