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 <QVBoxLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
// ConfigWindow contains the menus where you can configure the application
|
// 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);
|
m_buttonListView->setFlow(QListWidget::TopToBottom);
|
||||||
|
|
||||||
baseLayout->addWidget(m_buttonListView);
|
baseLayout->addWidget(m_buttonListView);
|
||||||
|
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigWindow::keyPressEvent(QKeyEvent *e) {
|
||||||
|
if (e->key() == Qt::Key_Escape) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
// InfoWindow show basic information about the usage of Flameshot
|
// InfoWindow show basic information about the usage of Flameshot
|
||||||
|
|
||||||
@@ -90,3 +91,9 @@ void InfoWindow::initInfoTable() {
|
|||||||
table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding,
|
table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding,
|
||||||
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:
|
public:
|
||||||
explicit InfoWindow(QWidget *parent = 0);
|
explicit InfoWindow(QWidget *parent = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initInfoTable();
|
void initInfoTable();
|
||||||
QVBoxLayout *layout;
|
QVBoxLayout *layout;
|
||||||
|
|||||||
Reference in New Issue
Block a user