From 319bab3dd37293cc696c5075b2713511589d8feb Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Fri, 3 Apr 2009 20:25:22 +0000 Subject: [PATCH] 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 --- src/dolphinsearchbox.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 #include +#include #include #include @@ -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(event)->key() == Qt::Key_Escape) { + m_searchInput->clear(); + } } return QWidget::event(event); } -- 2.47.3