summaryrefslogtreecommitdiff
path: root/src/tabwindow/tabbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-08-21 17:24:57 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit79170a62caf1cea6ab167ef6fe49d319a6eb9f29 (patch)
treea2c37853d86da56bf61c2649631463d2eae2d578 /src/tabwindow/tabbar.cpp
parentGet sure rekonq makes use of djvu plugin (diff)
downloadrekonq-79170a62caf1cea6ab167ef6fe49d319a6eb9f29.tar.xz
Fix tabbar size & new tab button position
Also, set tab preview popup width fixed This is heavily based on commits about this problem by Yoann Laissus. I modified a bit them to fit there + added (based on his idea) a double fixed size (default + minimal) for tabs
Diffstat (limited to 'src/tabwindow/tabbar.cpp')
-rw-r--r--src/tabwindow/tabbar.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp
index 6f7586d0..91d5e402 100644
--- a/src/tabwindow/tabbar.cpp
+++ b/src/tabwindow/tabbar.cpp
@@ -89,16 +89,15 @@ QSize TabBar::tabSizeHint(int index) const
QWidget* p = qobject_cast<QWidget *>(parent());
- int maxTabBarWidth = p->size().width();
-
- int baseTabWidth = maxTabBarWidth / genericTabNumber;
-
- int minTabWidth = p->sizeHint().width() / genericTabNumber;
-
- int w = baseTabWidth;
- if (count() > genericTabNumber)
+ int tabWidgetWidth = p->size().width();
+ int w = c_baseTabWidth;
+ if (w * count() > tabWidgetWidth)
{
- w = minTabWidth;
+ w = tabWidgetWidth / count();
+ if (w < c_minTabWidth)
+ {
+ w = c_minTabWidth;
+ }
}
int h = size().height();
@@ -394,6 +393,13 @@ void TabBar::mousePressEvent(QMouseEvent *event)
}
+void TabBar::tabLayoutChange()
+{
+ KTabBar::tabLayoutChange();
+ emit tabLayoutChanged();
+}
+
+
void TabBar::showTabPreview()
{
if (m_isFirstTimeOnTab)
@@ -416,7 +422,7 @@ void TabBar::showTabPreview()
if (indexedTab->isLoading())
return;
- int w = tabSizeHint(0).width();
+ int w = c_baseTabWidth;
int h = w * tabW->size().height() / tabW->size().width();
m_previewPopup = new TabPreviewPopup(indexedTab->tabPreview(w,h), indexedTab->url().url() , this);