1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +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:
nowrep 2012-04-25 11:35:13 +02:00
parent bacca991e0
commit e4e9639406
2 changed files with 18 additions and 11 deletions

View File

@ -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) {

View File

@ -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();