mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
add shortcut Escape button for closing images issues 672
This commit is contained in:
parent
6e8adc7320
commit
a88c68c0a8
2 changed files with 4 additions and 0 deletions
|
@ -31,6 +31,8 @@ ImageOverlay::ImageOverlay(QPixmap image, QWidget *parent)
|
||||||
|
|
||||||
connect(this, SIGNAL(closing()), this, SLOT(close()));
|
connect(this, SIGNAL(closing()), this, SLOT(close()));
|
||||||
|
|
||||||
|
close_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Escape), this, SLOT(close()));
|
||||||
|
|
||||||
raise();
|
raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
#include <QShortcut>
|
||||||
|
|
||||||
namespace dialogs {
|
namespace dialogs {
|
||||||
|
|
||||||
|
@ -32,5 +33,6 @@ private:
|
||||||
QRect content_;
|
QRect content_;
|
||||||
QRect close_button_;
|
QRect close_button_;
|
||||||
QRect save_button_;
|
QRect save_button_;
|
||||||
|
QShortcut *close_shortcut_;
|
||||||
};
|
};
|
||||||
} // dialogs
|
} // dialogs
|
||||||
|
|
Loading…
Reference in a new issue