mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Merge pull request #532 from salahmak/esc-cancel-upload
Pressing escape hides PreviewUploadOverlay
This commit is contained in:
commit
e46ddbbb45
2 changed files with 12 additions and 0 deletions
|
@ -203,3 +203,14 @@ PreviewUploadOverlay::setPreview(const QString &path)
|
||||||
setLabels(split[1], mime.name(), data_.size());
|
setLabels(split[1], mime.name(), data_.size());
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PreviewUploadOverlay::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if (event->matches(QKeySequence::Cancel)) {
|
||||||
|
emit aborted();
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
QWidget::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,6 +25,7 @@ public:
|
||||||
void setPreview(const QImage &src, const QString &mime);
|
void setPreview(const QImage &src, const QString &mime);
|
||||||
void setPreview(const QByteArray data, const QString &mime);
|
void setPreview(const QByteArray data, const QString &mime);
|
||||||
void setPreview(const QString &path);
|
void setPreview(const QString &path);
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void confirmUpload(const QByteArray data, const QString &media, const QString &filename);
|
void confirmUpload(const QByteArray data, const QString &media, const QString &filename);
|
||||||
|
|
Loading…
Reference in a new issue