diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2009-08-01 23:02:38 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2009-08-01 23:02:38 +0200 |
commit | ead1bfba857fca72643620ec211436aac5a12a8f (patch) | |
tree | 000121d3c35fdd91d576be6a5bea669017e5f4e6 /src/tabbar.cpp | |
parent | Merge branch 'FOCUSOUT' (diff) | |
download | rekonq-ead1bfba857fca72643620ec211436aac5a12a8f.tar.xz |
Dynamic tab bar
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r-- | src/tabbar.cpp | 16 |
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); |