diff options
author | Jon Ander Peñalba <jonan88@gmail.com> | 2010-11-30 22:04:41 +0100 |
---|---|---|
committer | Jon Ander Peñalba <jonan88@gmail.com> | 2010-11-30 22:04:41 +0100 |
commit | 491f63610fc9f74ca8097a516347f1399cbc71c2 (patch) | |
tree | 6eb71f8db630de6e510af44441656443da68758b /src/mainview.cpp | |
parent | Port SearchEngine from somewhat unsafe "naked" static variables to (diff) | |
download | rekonq-491f63610fc9f74ca8097a516347f1399cbc71c2.tar.xz |
Show and hide the add-tab button automatically
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 37a5df0d..850101e2 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -99,7 +99,7 @@ MainView::MainView(MainWindow *parent) void MainView::postLaunch() { QStringList list = Application::sessionManager()->closedSites(); - foreach(const QString &line, list) + Q_FOREACH(const QString &line, list) { if(line.startsWith( QL1S("about") )) break; @@ -176,41 +176,17 @@ WebTab *MainView::currentWebTab() const void MainView::updateTabBar() { - if (ReKonfig::alwaysShowTabBar()) + if (ReKonfig::alwaysShowTabBar() || tabBar()->count() > 1) { - if (!isTabBarHidden()) - { - if (tabBar()->isHidden()) - { - tabBar()->show(); - m_addTabButton->show(); - } - updateTabButtonPosition(); - } - return; + if (tabBar()->isHidden()) + tabBar()->show(); } - - if (tabBar()->count() == 1) + else { tabBar()->hide(); - m_addTabButton->hide(); - } - else if (!isTabBarHidden()) - { - if (tabBar()->isHidden()) - { - tabBar()->show(); - m_addTabButton->show(); - } - updateTabButtonPosition(); } -} - -void MainView::setTabBarHidden(bool hide) -{ - m_addTabButton->setVisible(!hide); - KTabWidget::setTabBarHidden(hide); + updateTabButtonPosition(); } @@ -557,7 +533,7 @@ void MainView::webViewIconChanged() WebView *view = qobject_cast<WebView *>(sender()); WebTab *tab = qobject_cast<WebTab *>(view->parent()); int index = indexOf(tab); - + if (-1 != index) { kDebug() << "TAB URL: " << tab->url(); |