Skip to content
Snippets Groups Projects
Unverified Commit d84c1f59 authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #679 from Kirillpt/iss_672

add shortcut Escape button for closing images. issue #672
parents 02b217d0 5335e043
No related branches found
No related tags found
No related merge requests found
Pipeline #1566 passed
......@@ -28,8 +28,10 @@ ImageOverlay::ImageOverlay(QPixmap image, QWidget *parent)
setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowState(Qt::WindowFullScreen);
close_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Escape), this);
connect(this, SIGNAL(closing()), this, SLOT(close()));
connect(close_shortcut_, &QShortcut::activated, this, &ImageOverlay::closing);
connect(this, &ImageOverlay::closing, this, &ImageOverlay::close);
raise();
}
......
......@@ -8,6 +8,7 @@
#include <QDialog>
#include <QMouseEvent>
#include <QPixmap>
#include <QShortcut>
namespace dialogs {
......@@ -32,5 +33,6 @@ private:
QRect content_;
QRect close_button_;
QRect save_button_;
QShortcut *close_shortcut_;
};
} // dialogs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment