From 39e797d2302a9ea1a48c13863b9c22f384e9d1f6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 29 Nov 2013 17:05:15 +0100 Subject: Changing tab width management behaviour Following hints from BUG: 322991 --- src/tabwindow/tabbar.cpp | 4 +++- src/tabwindow/tabbar.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tabwindow') diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp index b64e5655..40ced0a6 100644 --- a/src/tabwindow/tabbar.cpp +++ b/src/tabwindow/tabbar.cpp @@ -100,13 +100,15 @@ QSize TabBar::tabSizeHint(int index) const QWidget* p = qobject_cast(parent()); int w; + // if tab is pinned... if (tabData(index).toBool()) { w = 36; } else { - int tabWidgetWidth = p->size().width(); + // available width is tab widget width minus addTabButton width + int tabWidgetWidth = p->size().width() - 24; w = c_baseTabWidth; if (w * count() > tabWidgetWidth) { diff --git a/src/tabwindow/tabbar.h b/src/tabwindow/tabbar.h index 73b5802e..f842c9ff 100644 --- a/src/tabwindow/tabbar.h +++ b/src/tabwindow/tabbar.h @@ -104,8 +104,8 @@ private: int m_currentTabPreviewIndex; bool m_isFirstTimeOnTab; - static const int c_baseTabWidth = 200; - static const int c_minTabWidth = 100; + static const int c_baseTabWidth = 250; + static const int c_minTabWidth = 50; }; #endif // TAB_BAR -- cgit v1.2.1