From d247f7e36edcd805a0fff5bb281989aefd53e722 Mon Sep 17 00:00:00 2001 From: luddens Date: Wed, 15 May 2019 13:56:51 +0200 Subject: [PATCH] fix search bar bad reset Clear the search bar only if the focus is due to a mouse click --- src/searchbar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 3c56921..75e40c9 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "kiwixapp.h" @@ -82,7 +83,8 @@ void SearchBar::on_currentTitleChanged(const QString& title) void SearchBar::focusInEvent( QFocusEvent* event) { - clear(); + if (event->reason() == Qt::MouseFocusReason) + clear(); QLineEdit::focusInEvent(event); m_button.set_searchMode(true); }