summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2012-08-05 18:26:36 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-08-14 17:47:41 +0200
commitf93ee863768757ee4f37c4529c31cffde1ca71b9 (patch)
treee937b6f9deade969b982ae10304f1b7e5ee9d4a4 /src/tabbar.cpp
parentUse a default size for tab preview. (diff)
downloadrekonq-f93ee863768757ee4f37c4529c31cffde1ca71b9.tar.xz
Center the tab preview popup if the tab width is bigger or smaller
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index e3b44d53..ee210770 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -201,9 +201,13 @@ void TabBar::showTabPreview()
m_previewPopup = new TabPreviewPopup(indexedTab , this);
- int w = (mv->sizeHint().width() / baseWidthDivisor);
+ int w = tabSizeHint(m_currentTabPreviewIndex).width();
int tabBarWidth = mv->size().width();
int leftIndex = tabRect(m_currentTabPreviewIndex).x() + (tabRect(m_currentTabPreviewIndex).width() - w) / 2;
+ int popupWidth = m_previewPopup.data()->thumbnailSize().width();
+
+ // Center the popup if the tab width is bigger or smaller
+ leftIndex += (w - popupWidth) / 2;
if (leftIndex < 0)
{