mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-23 20:20:58 -04:00
fix search bar bad reset
Clear the search bar only if the focus is due to a mouse click
This commit is contained in:
parent
38037bbcdf
commit
d247f7e36e
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QFocusEvent>
|
||||||
|
|
||||||
#include "kiwixapp.h"
|
#include "kiwixapp.h"
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ void SearchBar::on_currentTitleChanged(const QString& title)
|
|||||||
|
|
||||||
void SearchBar::focusInEvent( QFocusEvent* event)
|
void SearchBar::focusInEvent( QFocusEvent* event)
|
||||||
{
|
{
|
||||||
|
if (event->reason() == Qt::MouseFocusReason)
|
||||||
clear();
|
clear();
|
||||||
QLineEdit::focusInEvent(event);
|
QLineEdit::focusInEvent(event);
|
||||||
m_button.set_searchMode(true);
|
m_button.set_searchMode(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user