summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-17 21:59:13 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-10-17 21:59:13 +0200
commit296daf6865daf07d75b9dfa5ff96c003f68f4410 (patch)
treee392ae3d8dbca8098529acf92da11784368c59c9 /src
parentFaster html elements check and better address resolution (diff)
downloadrekonq-296daf6865daf07d75b9dfa5ff96c003f68f4410.tar.xz
Fix tab bar visibility when set as auto-hide
BUG: 308421
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 15e0d5e4..b71a81ea 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -160,40 +160,40 @@ QList<TabHistory> MainView::recentlyClosedTabs()
void MainView::updateTabBarVisibility()
{
- if (ReKonfig::alwaysShowTabBar() || count() > 1)
- {
- // Get sure tabbar is well shown (and hided) during fullscreen navigation
- // NOTE: don't ask me why, but it seems that using code like:
- // MainWindow *w = qobject_cast<MainWindow *>(parent());
- // does NOT work here. So, I'm asking you: WHY???
- MainWindow *w = rApp->mainWindow();
- if (w && !w->isFullScreen())
+ // Get sure tabbar is well shown (and hided) during fullscreen navigation
+ // NOTE: don't ask me why, but it seems that using code like:
+ // MainWindow *w = qobject_cast<MainWindow *>(parent());
+ // does NOT work here. So, I'm asking you: WHY???
+ MainWindow *w = rApp->mainWindow();
+ if (w && !w->isFullScreen())
+ {
+ if (tabBar()->isHidden())
{
- if (tabBar()->isHidden())
- {
- tabBar()->show();
- }
-
- // this to ensure tab button visibility also on new window creation
- if (m_addTabButton->isHidden())
- {
- m_addTabButton->show();
- }
+ tabBar()->show();
+ }
+
+ // this to ensure tab button visibility also on new window creation
+ if (m_addTabButton->isHidden())
+ {
+ m_addTabButton->show();
}
- }
- else
- {
- tabBar()->hide();
- m_addTabButton->hide();
- return;
}
}
void MainView::updateAddTabButton()
{
- // update tab button position
+ if (!ReKonfig::alwaysShowTabBar())
+ {
+ bool b = (count() == 1);
+
+ tabBar()->setVisible(!b);
+ m_addTabButton->setVisible(!b);
+ if (b)
+ return;
+ }
+ // update tab button position
int tabWidgetWidth = frameSize().width();
int tabBarWidth = tabBar()->sizeHint().width();