aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/about.cpp8
-rw-r--r--src/about.h3
-rw-r--r--src/downloadmanagerwidget.cpp8
-rw-r--r--src/downloadmanagerwidget.h2
4 files changed, 21 insertions, 0 deletions
diff --git a/src/about.cpp b/src/about.cpp
index ba54a7e..81657e8 100644
--- a/src/about.cpp
+++ b/src/about.cpp
@@ -92,6 +92,14 @@ void About::on_debugInfoButton_clicked() {
}
}
+void About::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Escape)
+ this->close();
+
+ QWidget::keyPressEvent(e);
+}
+
void About::on_donate_2_clicked() {
QDesktopServices::openUrl(QUrl("https://opencollective.com/whatsie"));
}
diff --git a/src/about.h b/src/about.h
index 74bfe0d..cd9e978 100644
--- a/src/about.h
+++ b/src/about.h
@@ -2,6 +2,7 @@
#define ABOUT_H
#include <QWidget>
+#include <QKeyEvent>
namespace Ui {
class About;
@@ -15,6 +16,8 @@ public:
explicit About(QWidget *parent = nullptr);
~About();
+protected slots:
+ void keyPressEvent(QKeyEvent *e);
private slots:
void on_debugInfoButton_clicked();
diff --git a/src/downloadmanagerwidget.cpp b/src/downloadmanagerwidget.cpp
index 2d75287..e9865c8 100644
--- a/src/downloadmanagerwidget.cpp
+++ b/src/downloadmanagerwidget.cpp
@@ -56,3 +56,11 @@ void DownloadManagerWidget::on_open_download_dir_clicked() {
QApplication::applicationName())
.toString());
}
+
+void DownloadManagerWidget::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Escape)
+ this->close();
+
+ QWidget::keyPressEvent(e);
+}
diff --git a/src/downloadmanagerwidget.h b/src/downloadmanagerwidget.h
index 7fa0950..4a8d059 100644
--- a/src/downloadmanagerwidget.h
+++ b/src/downloadmanagerwidget.h
@@ -75,6 +75,8 @@ public:
// will be shown on the screen.
void downloadRequested(QWebEngineDownloadItem *webItem);
+protected slots:
+ void keyPressEvent(QKeyEvent *e);
private slots:
void on_open_download_dir_clicked();