From: Sascha Peilicke Date: Fri, 3 Apr 2009 20:25:22 +0000 (+0000) Subject: This patch allows the user to clear the search bar with an Escape keypress. This... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/319bab3dd37293cc696c5075b2713511589d8feb 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 --- 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); }