From 3aaf7be9670b09a2f7f9d5a2484e854135453c46 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 14 Oct 2009 12:23:22 +0200 Subject: Another fix for the new tab button... I'm starting hating it!! --- src/mainview.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/mainview.cpp') 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 -- cgit v1.2.1