Merge pull request #532 from salahmak/esc-cancel-upload

Pressing escape hides PreviewUploadOverlay
pull/534/head
DeepBlueV7.X 4 years ago committed by GitHub
commit e46ddbbb45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/dialogs/PreviewUploadOverlay.cpp
  2. 1
      src/dialogs/PreviewUploadOverlay.h

@ -203,3 +203,14 @@ PreviewUploadOverlay::setPreview(const QString &path)
setLabels(split[1], mime.name(), data_.size());
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 QByteArray data, const QString &mime);
void setPreview(const QString &path);
void keyPressEvent(QKeyEvent *event);
signals:
void confirmUpload(const QByteArray data, const QString &media, const QString &filename);

Loading…
Cancel
Save