mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 21:38:45 -04:00
Emit currentTitleChanged
when we change tab.
To allow the searchBar to follow tab change and adapt itself.
This commit is contained in:
parent
d52dab04ce
commit
f45ab71923
@ -2,6 +2,7 @@
|
||||
|
||||
#include "kiwixapp.h"
|
||||
#include <QAction>
|
||||
#include <QTimer>
|
||||
|
||||
#define QUITIFNULL(VIEW) if (nullptr==(VIEW)) { return; }
|
||||
#define QUITIFNOTCURRENT(VIEW) if((VIEW)!=currentWidget()) {return;}
|
||||
@ -179,9 +180,11 @@ void TabBar::onCurrentChanged(int index)
|
||||
emit webActionEnabledChanged(QWebEnginePage::Back, view->isWebActionEnabled(QWebEnginePage::Back));
|
||||
emit webActionEnabledChanged(QWebEnginePage::Forward, view->isWebActionEnabled(QWebEnginePage::Forward));
|
||||
KiwixApp::instance()->setSideBar(KiwixApp::NONE);
|
||||
QTimer::singleShot(0, [=](){emit currentTitleChanged(view->title());});
|
||||
} else {
|
||||
emit webActionEnabledChanged(QWebEnginePage::Back, false);
|
||||
emit webActionEnabledChanged(QWebEnginePage::Forward, false);
|
||||
KiwixApp::instance()->setSideBar(KiwixApp::CONTENTMANAGER_BAR);
|
||||
QTimer::singleShot(0, [=](){emit currentTitleChanged("");});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user