diff options
| author | Sascha Peilicke <[email protected]> | 2009-04-03 20:25:22 +0000 |
|---|---|---|
| committer | Sascha Peilicke <[email protected]> | 2009-04-03 20:25:22 +0000 |
| commit | 319bab3dd37293cc696c5075b2713511589d8feb (patch) | |
| tree | ad4ac0cc1b5d0e3e352c6707cd2e64079fb168fd | |
| parent | 4a6269304fab2a6a3771c5466c9c946da92d93f0 (diff) | |
This patch allows the user to clear the search bar with an Escape keypress. This should help with keyboard-only navigation.
svn path=/trunk/KDE/kdebase/apps/; revision=948807
| -rw-r--r-- | src/dolphinsearchbox.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dolphinsearchbox.cpp b/src/dolphinsearchbox.cpp index cc305599f..d27b08014 100644 --- a/src/dolphinsearchbox.cpp +++ b/src/dolphinsearchbox.cpp @@ -26,6 +26,7 @@ #include <kiconloader.h> #include <QEvent> +#include <QKeyEvent> #include <QHBoxLayout> #include <QToolButton> @@ -63,6 +64,10 @@ bool DolphinSearchBox::event(QEvent* event) { if (event->type() == QEvent::Polish) { m_searchInput->setFont(KGlobalSettings::generalFont()); + } else if (event->type() == QEvent::KeyPress) { + if (static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) { + m_searchInput->clear(); + } } return QWidget::event(event); } |
