mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-01-03 23:55:17 +00:00
Add close after Escape pressed on info and config windows
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QKeyEvent>
|
||||
|
||||
// ConfigWindow contains the menus where you can configure the application
|
||||
|
||||
@@ -47,5 +48,12 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QWidget(parent) {
|
||||
m_buttonListView->setFlow(QListWidget::TopToBottom);
|
||||
|
||||
baseLayout->addWidget(m_buttonListView);
|
||||
|
||||
show();
|
||||
}
|
||||
|
||||
void ConfigWindow::keyPressEvent(QKeyEvent *e) {
|
||||
if (e->key() == Qt::Key_Escape) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
signals:
|
||||
void setDefaults();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <QTableWidget>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QKeyEvent>
|
||||
|
||||
// InfoWindow show basic information about the usage of Flameshot
|
||||
|
||||
@@ -90,3 +91,9 @@ void InfoWindow::initInfoTable() {
|
||||
table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding,
|
||||
QSizePolicy::Expanding);
|
||||
}
|
||||
|
||||
void InfoWindow::keyPressEvent(QKeyEvent *e) {
|
||||
if (e->key() == Qt::Key_Escape) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ class InfoWindow : public QWidget {
|
||||
public:
|
||||
explicit InfoWindow(QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
|
||||
private:
|
||||
void initInfoTable();
|
||||
QVBoxLayout *layout;
|
||||
|
||||
Reference in New Issue
Block a user