mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Fixed "Hide tabs when there is only one tab" option.
- fixed hiding tabbar when using "Close other tabs" action
This commit is contained in:
parent
bacca991e0
commit
e4e9639406
|
@ -289,13 +289,6 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
|
|||
m_lastBackgroundTabIndex = index;
|
||||
}
|
||||
|
||||
if (count() == 1 && m_hideTabBarWithOneTab) {
|
||||
tabBar()->setVisible(false);
|
||||
}
|
||||
else {
|
||||
tabBar()->setVisible(true);
|
||||
}
|
||||
|
||||
connect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
|
||||
connect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged()));
|
||||
connect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
|
||||
|
@ -350,6 +343,7 @@ void TabWidget::closeTab(int index)
|
|||
disconnect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
|
||||
disconnect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged()));
|
||||
disconnect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
|
||||
|
||||
//Save last tab url and history
|
||||
m_closedTabsManager->saveView(webTab, index);
|
||||
|
||||
|
@ -357,10 +351,6 @@ void TabWidget::closeTab(int index)
|
|||
setCurrentIndex(m_lastTabIndex);
|
||||
}
|
||||
|
||||
if (count() == 2 && m_hideTabBarWithOneTab) {
|
||||
tabBar()->setVisible(false);
|
||||
}
|
||||
|
||||
m_lastBackgroundTabIndex = -1;
|
||||
|
||||
webPage->disconnectObjects();
|
||||
|
@ -400,6 +390,20 @@ void TabWidget::tabMoved(int before, int after)
|
|||
m_lastBackgroundTabIndex = -1;
|
||||
}
|
||||
|
||||
void TabWidget::tabInserted(int index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
|
||||
tabBar()->setVisible(!(count() == 1 && m_hideTabBarWithOneTab));
|
||||
}
|
||||
|
||||
void TabWidget::tabRemoved(int index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
|
||||
tabBar()->setVisible(!(count() == 1 && m_hideTabBarWithOneTab));
|
||||
}
|
||||
|
||||
void TabWidget::startTabAnimation(int index)
|
||||
{
|
||||
if (index == -1) {
|
||||
|
|
|
@ -118,6 +118,9 @@ private slots:
|
|||
void tabMoved(int before, int after);
|
||||
|
||||
private:
|
||||
void tabInserted(int index);
|
||||
void tabRemoved(int index);
|
||||
|
||||
void resizeEvent(QResizeEvent* e);
|
||||
|
||||
WebTab* weTab();
|
||||
|
|
Loading…
Reference in New Issue
Block a user