summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 46cd9a15..7dbe8b23 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -186,12 +186,15 @@ void MainView::updateTabBar()
{
if (ReKonfig::alwaysShowTabBar())
{
- if (m_tabBar->isHidden())
+ if (!isTabBarHidden())
{
- m_tabBar->show();
- m_addTabButton->show();
+ if (m_tabBar->isHidden())
+ {
+ m_tabBar->show();
+ m_addTabButton->show();
+ }
+ updateTabButtonPosition();
}
- updateTabButtonPosition();
return;
}
@@ -200,7 +203,7 @@ void MainView::updateTabBar()
m_tabBar->hide();
m_addTabButton->hide();
}
- else
+ else if (!isTabBarHidden())
{
if (m_tabBar->isHidden())
{
@@ -212,6 +215,13 @@ void MainView::updateTabBar()
}
+void MainView::setTabBarHidden(bool hide)
+{
+ m_addTabButton->setVisible(!hide);
+ KTabWidget::setTabBarHidden(hide);
+}
+
+
void MainView::webReload()
{
WebTab *webTab = currentWebTab();
@@ -447,9 +457,26 @@ void MainView::cloneTab(int index)
// When index is -1 index chooses the current tab
void MainView::closeTab(int index)
{
- // do nothing if just one tab is opened
+ // open default homePage if just one tab is opened
if (count() == 1)
+ {
+ WebView *w = currentWebTab()->view();
+ urlBar()->setUrl(KUrl(""));
+ switch(ReKonfig::newTabsBehaviour())
+ {
+ case 0: // new tab page
+ case 1: // blank page
+ w->load( KUrl("about:home") );
+ break;
+ case 2: // homepage
+ w->load( KUrl(ReKonfig::homePage()) );
+ break;
+ default:
+ break;
+ }
+ urlBar()->setFocus();
return;
+ }
if (index < 0)
index = currentIndex();