summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-20 01:56:32 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-20 01:56:32 +0100
commit987eca7269ebac1d820914919b3ed93f1c6e9b84 (patch)
tree1232e593323a9102de533842efdc9a03adf6a993 /src/tabbar.cpp
parentForgot header.. ;) (diff)
downloadrekonq-987eca7269ebac1d820914919b3ed93f1c6e9b84.tar.xz
Fixed tabs dimension && reduced tabbar font
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 8f648f28..ac18d7e8 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -35,33 +35,25 @@
#include <KMessageBox>
#include <KAction>
#include <KDebug>
+#include <KGlobalSettings>
// Qt Includes
#include <QtGui>
-#include <QDebug>
TabBar::TabBar(QWidget *parent)
: KTabBar(parent)
+ , m_parent(parent)
{
setElideMode(Qt::ElideRight);
setContextMenuPolicy(Qt::CustomContextMenu);
setAcceptDrops(true);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
-// FIXME: not sure we need this..
-// QString alt = QLatin1String("Alt+%1");
-// for (int i = 1; i <= 10; ++i)
-// {
-// int key = i;
-// if (key == 10)
-// {
-// key = 0;
-// }
-// QShortcut *shortCut = new QShortcut(alt.arg(key), this);
-// m_tabShortcuts.append(shortCut);
-// connect(shortCut, SIGNAL(activated()), this, SLOT(selectTabAction()));
-// }
+ QFont standardFont = KGlobalSettings::generalFont();
+ QString fontFamily = standardFont.family();
+ int dim = standardFont.pointSize();
+ setFont( QFont(fontFamily, dim-2) );
}
@@ -70,6 +62,18 @@ TabBar::~TabBar()
}
+QSize TabBar::tabSizeHint (int index) const
+{
+ Q_UNUSED(index);
+ QSize s = m_parent->sizeHint();
+ int w = s.width() / 5;
+ int h = s.height() / 20;
+
+ QSize ts = QSize(w,h);
+ return ts;
+}
+
+
void TabBar::selectTabAction()
{
if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender()))