fix search bar bad reset

Clear the search bar only if the focus is due to a mouse click
This commit is contained in:
luddens 2019-05-15 13:56:51 +02:00
parent 38037bbcdf
commit d247f7e36e

View File

@ -2,6 +2,7 @@
#include <QCompleter>
#include <QTimer>
#include <QFocusEvent>
#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);
}