[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Btelepathy-chat-handler=5D_lib=3A_Close_the_find_bar?=
From:       Lasse Liehu <lliehu () kolumbus ! fi>
Date:       2011-04-12 12:06:36
Message-ID: 20110412120636.70510A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 9972b54b93f68ffaa57129e670fd02486094ab66 by Lasse Liehu.
Committed on 12/04/2011 at 14:53.
Pushed by lliehu into branch 'master'.

Close the find bar by pressing Esc
REVIEW:101094

M  +8    -0    lib/chat-widget.cpp     
M  +2    -0    lib/chat-widget.h     

http://commits.kde.org/telepathy-chat-handler/9972b54b93f68ffaa57129e670fd02486094ab66

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index af7edff..3611590 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -308,6 +308,14 @@ void ChatWidget::showEvent(QShowEvent* e)
     QWidget::showEvent(e);
 }
 
+void ChatWidget::keyPressEvent(QKeyEvent* e)
+{
+    if (e->key() == Qt::Key_Escape && d->ui.searchBar->isVisible()) {
+        d->ui.searchBar->toggleView(false);
+    } else {
+        QWidget::keyPressEvent(e);
+    }
+}
 
 QString ChatWidget::title() const
 {
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index fdf5ccd..92cda98 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -34,6 +34,7 @@
 class ChatSearchBar;
 class ChatWidgetPrivate;
 class QShowEvent;
+class QKeyEvent;
 
 class KDE_TELEPATHY_CHAT_EXPORT ChatWidget : public QWidget
 {
@@ -68,6 +69,7 @@ protected:
     void changeEvent(QEvent *e);
     void resizeEvent(QResizeEvent *);
     void showEvent(QShowEvent *e);
+    void keyPressEvent(QKeyEvent *e);
 
 protected slots:
     /** Show the received message in the chat window*/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic