summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-21 12:12:36 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-21 12:12:36 +0100
commit5a8bb470bc30bf6a360661a87af783fd30588f5f (patch)
treeceb8b0a5ed056c77ecc2ea00d7778cb2b19aa50c /src/mainview.cpp
parentFixed tabs dimension && reduced tabbar font (diff)
downloadrekonq-5a8bb470bc30bf6a360661a87af783fd30588f5f.tar.xz
Always Show Tab Bar. Or not...
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index d7e07e14..407db6fe 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -23,6 +23,9 @@
#include "mainview.h"
#include "mainview.moc"
+// Auto Includes
+#include "rekonq.h"
+
// Local Includes
#include "tabbar.h"
#include "application.h"
@@ -86,6 +89,26 @@ MainView::~MainView()
}
+void MainView::viewTabBar()
+{
+ bool always = ReKonfig::alwaysShowTabBar();
+ if(always == true)
+ return;
+
+ if( m_tabBar->count() == 1 )
+ {
+ m_tabBar->hide();
+ }
+ else
+ {
+ if( m_tabBar->isHidden() )
+ {
+ m_tabBar->show();
+ }
+ }
+}
+
+
KAction *MainView::recentlyClosedTabsAction() const
{
return m_recentlyClosedTabsAction;
@@ -367,6 +390,9 @@ WebView *MainView::newTab(bool makeCurrent)
if (count() == 1)
currentChanged(currentIndex());
emit tabsChanged();
+
+ viewTabBar();
+
return webView;
}
@@ -420,6 +446,8 @@ void MainView::closeOtherTabs(int index)
closeTab(i);
for (int i = index - 1; i >= 0; --i)
closeTab(i);
+
+ viewTabBar();
}
@@ -432,6 +460,8 @@ void MainView::cloneTab(int index)
return;
WebView *tab = newTab(false);
tab->setUrl( webView(index)->url() );
+
+ viewTabBar();
}
@@ -474,6 +504,8 @@ void MainView::closeTab(int index)
currentWebView()->setFocus();
if (count() == 0)
emit lastTabClosed();
+
+ viewTabBar();
}