Commit 1a56221e authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Config: Dont close on ESC key press

parent 0d514558
......@@ -783,6 +783,18 @@ int KateConfigDialog::recentFilesMaxCount()
return maxItems;
}
bool KateConfigDialog::event(QEvent *event)
{
if (event->type() == QEvent::ShortcutOverride || event->type() == QEvent::KeyPress) {
auto keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->modifiers().testFlag(Qt::NoModifier) && keyEvent->key() == Qt::Key_Escape) {
event->accept();
return true;
}
}
return KPageDialog::event(event);
}
void KateConfigDialog::closeEvent(QCloseEvent *event)
{
if (!m_dataChanged) {
......
......@@ -78,6 +78,7 @@ protected Q_SLOTS:
protected:
void closeEvent(QCloseEvent *event) override;
bool event(QEvent *event) override;
private:
void addBehaviorPage();
......
Supports Markdown
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