mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 04:32:15 -04:00
set focus on searchbar when opening a tab
the searchbar isn't update if it has the focus
This commit is contained in:
parent
47cc29d31c
commit
1c7b900aef
@ -81,6 +81,9 @@ SearchBar::SearchBar(QWidget *parent) :
|
||||
|
||||
void SearchBar::on_currentTitleChanged(const QString& title)
|
||||
{
|
||||
if (this->hasFocus()) {
|
||||
return;
|
||||
}
|
||||
if (!title.startsWith("zim://")) {
|
||||
setText(title);
|
||||
} else {
|
||||
|
@ -29,6 +29,7 @@ TabBar::TabBar(QWidget *parent) :
|
||||
auto widget = this->createNewTab(true);
|
||||
QUITIFNULL(current);
|
||||
widget->setUrl(current->url());
|
||||
KiwixApp::instance()->getMainWindow()->getTopWidget()->getSearchBar().setFocus(Qt::MouseFocusReason);
|
||||
});
|
||||
connect(app->getAction(KiwixApp::CloseTabAction), &QAction::triggered,
|
||||
this, [=]() {
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
explicit TopWidget(QWidget *parent = nullptr);
|
||||
virtual ~TopWidget();
|
||||
|
||||
SearchBar &getSearchBar() { return m_searchEntry; };
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user