[kdebase] - konsole minimum tab width is too wide (#632217, kde#166573)

Rex Dieter rdieter at fedoraproject.org
Mon Sep 20 13:39:34 UTC 2010


commit bc2e734e45b9e24781acc879f7efe6cc1bdec310
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon Sep 20 08:45:03 2010 -0500

    - konsole minimum tab width is too wide (#632217, kde#166573)

 kdebase-konsole_min_tab_width.patch |   42 +++++++++++++++++++++++++++++++++++
 kdebase.spec                        |    8 +++++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/kdebase-konsole_min_tab_width.patch b/kdebase-konsole_min_tab_width.patch
new file mode 100644
index 0000000..9e4c5a7
--- /dev/null
+++ b/kdebase-konsole_min_tab_width.patch
@@ -0,0 +1,42 @@
+--- branches/KDE/4.5/kdebase/apps/konsole/src/ViewContainer.cpp	2010/09/10 02:31:00	1173667
++++ branches/KDE/4.5/kdebase/apps/konsole/src/ViewContainer.cpp	2010/09/10 02:31:33
+@@ -260,6 +260,7 @@ 
+     , _dropIndicatorIndex(-1)
+     , _drawIndicatorDisabled(false)
+ {
++    setStyleSheet("QTabBar::tab { min-width: 2em; max-width: 25em }");
+     setElideMode(Qt::ElideLeft);
+ }
+ void ViewContainerTabBar::setDropIndicator(int index, bool drawDisabled)
+@@ -396,29 +397,10 @@ 
+         event->ignore();
+ }
+ 
+-/* Try to provide a reasonable tab width:
+- * If there are less than 5 tabs, let the tabs fill out the tabbar.
+- * Otherwise, check the tab text size and the minimumTabWidth value.
+- * The minimumTabWidth is to prevent the tabs from getting too
+- * small such that no scroll indicators will appear.
+-*/
++/* A stylesheet is used now to handle width of tab. */
+ QSize ViewContainerTabBar::tabSizeHint(int index) const
+ {
+-    const int fillTabCount = 5;
+-    const int minimumTabWidth = 150; // Arbitrary value
+-    int tabBarWidth = rect().width();
+-    int tabCount = count();
+-    int tabMaxWidth;
+-    if (tabCount <= fillTabCount)
+-        tabMaxWidth = tabBarWidth / (tabCount + 0.5);
+-    else
+-        tabMaxWidth = tabBarWidth / (fillTabCount + 0.5);
+-
+-    int tabTextWidth = fontMetrics().width(tabText(index));
+-    // qBound ( minimum, value, max )
+-    QSize size (qBound(minimumTabWidth, tabTextWidth, tabMaxWidth),
+-                QTabBar::tabSizeHint(index).height());
+-    return size;
++    return QTabBar::tabSizeHint(index);
+ }
+ QPixmap ViewContainerTabBar::dragDropPixmap(int tab) 
+ {
diff --git a/kdebase.spec b/kdebase.spec
index 0fd9b69..e0a2dd4 100644
--- a/kdebase.spec
+++ b/kdebase.spec
@@ -2,7 +2,7 @@ Name:    kdebase
 Summary: KDE Core Applications 
 Epoch:   6
 Version: 4.5.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: GPLv2
 Group: User Interface/Desktops
@@ -21,6 +21,8 @@ Patch3:   kdebase-4.4.0-konqueror-kde#228593.patch
 ## upstream patches
 # backport http://websvn.kde.org/?view=revision&revision=1168744
 Patch100: kdebase-4.5.1-ebrowsing_categories.patch
+# http://bugs.kde.org/166573 -  minimum tab width is too wide 
+Patch101: kdebase-konsole_min_tab_width.patch 
 
 %ifnarch s390 s390x
 Requires: eject
@@ -115,6 +117,7 @@ Requires: kdelibs4-devel kdepimlibs4-devel
 %patch2 -p1 -b .home-icon
 %patch3 -p1 -b .kde#228593
 %patch100 -p3 -b .ebrowsing_categories
+%patch101 -p4 -b .konsole_min_tab_width
 
 
 %build
@@ -270,6 +273,9 @@ fi
 
 
 %changelog
+* Mon Sep 20 2010 Rex Dieter <rdieter at fedoraproject.org> - 6:4.5.1-2
+- konsole minimum tab width is too wide (#632217, kde#166573)
+
 * Fri Aug 27 2010 Jaroslav Reznik <jreznik at redhat.com> - 6:4.5.1-1
 - 4.5.1
 


More information about the scm-commits mailing list