Commit 007eae88 authored by JanKusanagi's avatar JanKusanagi

Allow closing with ESC

parent 002d8cae
......@@ -56,6 +56,14 @@ CharacterPicker::CharacterPicker(QWidget *parent) : QWidget(parent)
this->setLayout(m_mainLayout);
// ESC to close
m_closeAction = new QAction(this);
m_closeAction->setShortcut(QKeySequence(Qt::Key_Escape));
connect(m_closeAction, &QAction::triggered,
this, &QWidget::close);
this->addAction(m_closeAction);
// Prepare to keep track of block and font size changes
m_displayedCodePoints = m_charSelect->displayedCodePoints();
m_fontSize = m_charSelect->currentFont().pointSize();
......
......@@ -25,6 +25,7 @@
#include <QVBoxLayout>
#include <KCharSelect>
#include <QPushButton>
#include <QAction>
#include <QCloseEvent>
#include <QSettings>
......@@ -57,6 +58,8 @@ private:
QVector<uint> m_displayedCodePoints;
int m_fontSize;
QAction *m_closeAction;
};
#endif // CHARACTERPICKER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment