summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmailbase.cpp10
-rw-r--r--noncore/net/mail/viewmailbase.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp
index 153ba9d..7f1d8a0 100644
--- a/noncore/net/mail/viewmailbase.cpp
+++ b/noncore/net/mail/viewmailbase.cpp
@@ -76,7 +76,15 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
void ViewMailBase::slotChangeAttachview(bool state)
{
if (state) attachments->show();
else attachments->hide();
}
-
+void ViewMailBase::keyPressEvent ( QKeyEvent * e )
+{
+ if( e->key()==Qt::Key_Escape ) {
+ close();
+ e->accept();
+ return;
+ }
+ QWidget::keyPressEvent(e);
+}
diff --git a/noncore/net/mail/viewmailbase.h b/noncore/net/mail/viewmailbase.h
index 6d2a5b2..fdaad2a 100644
--- a/noncore/net/mail/viewmailbase.h
+++ b/noncore/net/mail/viewmailbase.h
@@ -26,12 +26,13 @@ protected:
OpenDiag *openDiag;
QMenuBar *menubar;
QPopupMenu *mailmenu;
protected slots:
void slotChangeAttachview(bool state);
+ virtual void keyPressEvent ( QKeyEvent * e );
};
#endif