diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2011-09-20 17:55:46 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2011-09-20 17:55:46 +0200 |
commit | 5ba5ca480db1eb14fa1163ce5ac1640f66125b21 (patch) | |
tree | cbcef92140ac91161531667ae54e743c6d946efc /src/mainview.cpp | |
parent | QtWebKit 2.2 related fixes (diff) | |
download | rekonq-5ba5ca480db1eb14fa1163ce5ac1640f66125b21.tar.xz |
Fix tab size and addTabButton position when a KMessageWidget appears
REVIEW: 102651
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 716e8dab..89c380de 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -62,6 +62,7 @@ QString temporaryUglyHackString = ""; MainView::MainView(MainWindow *parent) : KTabWidget(parent) , m_widgetBar(new StackedUrlBar(this)) + , m_originalWidthHint(0) , m_addTabButton(0) , m_currentTabIndex(0) , m_parentWindow(parent) @@ -114,6 +115,7 @@ void MainView::postLaunch() m_addTabButton->setAutoRaise(true); m_addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + m_originalWidthHint = sizeHint().width(); } @@ -186,13 +188,7 @@ void MainView::updateTabBar() ButtonInCorner = false; } - // detecting X position - int newPosX = tabBarWidth; - int tabWidthHint = tabBar()->tabSizeHint(0).width(); - if (tabWidthHint < sizeHint().width() / 4) - newPosX = tabWidgetWidth - m_addTabButton->width(); - - m_addTabButton->move(newPosX, 0); + m_addTabButton->move(tabBarWidth, 0); } } @@ -332,6 +328,12 @@ WebTab *MainView::newWebTab(bool focused) } +int MainView::originalWidthHint() const +{ + return m_originalWidthHint; +} + + void MainView::newTab() { WebView *w = newWebTab()->view(); |