summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-08-01 23:02:38 +0200
committermegabigbug <megabigbug@arrakis.(none)>2009-08-01 23:02:38 +0200
commitead1bfba857fca72643620ec211436aac5a12a8f (patch)
tree000121d3c35fdd91d576be6a5bea669017e5f4e6 /src/tabbar.cpp
parentMerge branch 'FOCUSOUT' (diff)
downloadrekonq-ead1bfba857fca72643620ec211436aac5a12a8f.tar.xz
Dynamic tab bar
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 08603789..fd27db85 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -70,9 +70,21 @@ TabBar::~TabBar()
QSize TabBar::tabSizeHint(int index) const
{
- QSize s = m_parent->sizeHint();
+ //TODO Create a SuperTabWidget class
+
+ int buttonSize = ((MainView *)m_parent)->addTabButton()->size().width();
+ int tabBarWidth = m_parent->size().width() - buttonSize;
+ int baseWidth = m_parent->sizeHint().width()/4;
+ int minWidth = m_parent->sizeHint().width()/8;
+
+ int w;
+ if (baseWidth*count()<tabBarWidth)
+ w=baseWidth;
+ else if (tabBarWidth/count()>minWidth)
+ w=tabBarWidth/count();
+ else
+ w=minWidth;
- int w = s.width() / 4;
int h = KTabBar::tabSizeHint(index).height();
QSize ts = QSize(w, h);