summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
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)
{