summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-14 12:23:22 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-14 12:23:22 +0200
commit3aaf7be9670b09a2f7f9d5a2484e854135453c46 (patch)
tree1f32696464120738f7f36cdb0d3a85ad5eb1d671 /src/mainview.cpp
parentrekonq 0.2.66 (diff)
downloadrekonq-3aaf7be9670b09a2f7f9d5a2484e854135453c46.tar.xz
Another fix for the new tab button...
I'm starting hating it!!
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index ba7b720e..a0b0c6e7 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -131,7 +131,7 @@ int MainView::webViewIndex(WebView *webView) const
}
-void MainView::showTabBar()
+void MainView::updateTabBar()
{
if (ReKonfig::alwaysShowTabBar())
{
@@ -139,6 +139,7 @@ void MainView::showTabBar()
{
m_tabBar->show();
}
+ m_tabBar->updateNewTabButton();
}
else
{
@@ -152,6 +153,7 @@ void MainView::showTabBar()
{
m_tabBar->show();
}
+ m_tabBar->updateNewTabButton();
}
}
}
@@ -283,15 +285,15 @@ WebView *MainView::newWebView(bool focused, bool nearParent)
insertTab(currentIndex() + 1, webView, i18n("(Untitled)"));
else
addTab(webView, i18n("(Untitled)"));
-
+
+ updateTabBar();
+
if (focused)
{
setCurrentWidget(webView);
}
emit tabsChanged();
-
- showTabBar();
return webView;
}
@@ -369,7 +371,7 @@ void MainView::slotCloseOtherTabs(int index)
slotCloseTab(i);
}
- showTabBar();
+ updateTabBar();
}
@@ -383,7 +385,7 @@ void MainView::slotCloneTab(int index)
WebView *tab = newWebView();
tab->setUrl(webView(index)->url());
- showTabBar();
+ updateTabBar();
}
@@ -418,6 +420,7 @@ void MainView::slotCloseTab(int index)
QWidget *webView = widget(index);
removeTab(index);
+ updateTabBar(); // UI operation: do it ASAP!!
webView->deleteLater(); // webView is scheduled for deletion.
emit tabsChanged();
@@ -426,8 +429,6 @@ void MainView::slotCloseTab(int index)
{
currentWebView()->setFocus();
}
-
- showTabBar();
}
@@ -578,3 +579,10 @@ KUrl::List MainView::recentlyClosedTabs()
{
return m_recentlyClosedTabs;
}
+
+
+void MainView::resizeEvent(QResizeEvent *event)
+{
+ updateTabBar();
+ KTabWidget::resizeEvent(event);
+} \ No newline at end of file