summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-23 12:26:36 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-23 12:26:36 (GMT)
commitf8c3de208c11aaa9e616554508f51940c0cd244d (patch)
tree10d188420516384094ba730c6f072ba9eb810d31
parent430985175bfb26b4d30e7850e2db472baf30c250 (diff)
no one pixel border
-rw-r--r--kate/app/katetabbar.cpp33
-rw-r--r--kate/app/katetabbar.h3
-rw-r--r--kate/app/katetabbutton.cpp1
3 files changed, 4 insertions, 33 deletions
diff --git a/kate/app/katetabbar.cpp b/kate/app/katetabbar.cpp
index c3811fb..9c6589a 100644
--- a/kate/app/katetabbar.cpp
+++ b/kate/app/katetabbar.cpp
@@ -95,7 +95,8 @@ KateTabBar::KateTabBar(QWidget *parent)
m_minimumTabWidth = 150;
m_maximumTabWidth = 350;
- m_tabHeight = 22;
+ // fixme: better additional size
+ m_tabHeight = QFontMetrics(font()).height() + 10;
m_sortType = OpeningOrder;
m_nextID = 0;
@@ -134,7 +135,6 @@ void KateTabBar::load(KConfigBase *config, const QString &group)
// tabbar properties
setMinimumTabWidth(cg.readEntry("minimum width", m_minimumTabWidth));
setMaximumTabWidth(cg.readEntry("maximum width", m_maximumTabWidth));
- setTabHeight(cg.readEntry("fixed height", m_tabHeight));
setTabSortType((SortType) cg.readEntry("sort type", (int)OpeningOrder));
// highlighted entries
@@ -162,7 +162,6 @@ void KateTabBar::save(KConfigBase *config, const QString &group) const
// tabbar properties
cg.writeEntry("minimum width", minimumTabWidth());
cg.writeEntry("maximum width", maximumTabWidth());
- cg.writeEntry("fixed height", tabHeight());
cg.writeEntry("sort type", (int)tabSortType());
// highlighted entries
@@ -213,30 +212,6 @@ int KateTabBar::maximumTabWidth() const
}
/**
- * Set the fixed height in pixels all tabs have.
- * \note If you also show icons use a height of iconheight + 2.
- * E.g. for 16x16 pixel icons, a tab height of 18 pixel looks best.
- * For 22x22 pixel icons a height of 24 pixel is best etc.
- */
-void KateTabBar::setTabHeight(int height_pixel)
-{
- if (m_tabHeight == height_pixel) {
- return;
- }
-
- m_tabHeight = height_pixel;
- updateFixedHeight();
-}
-
-/**
- * Get the fixed tab height in pixels.
- */
-int KateTabBar::tabHeight() const
-{
- return m_tabHeight;
-}
-
-/**
* Adds a new tab with text \a text. Returns the new tab's ID.
*/
int KateTabBar::addTab(const QString &text)
@@ -643,7 +618,7 @@ void KateTabBar::resizeEvent(QResizeEvent *event)
tabButton->hide();
} else {
const int w = ceil(tabWidth);
- tabButton->setGeometry(i * w, 0, w, tabHeight());
+ tabButton->setGeometry(i * w, 0, w, m_tabHeight);
tabButton->show();
}
}
@@ -666,7 +641,7 @@ int KateTabBar::maxTabCount() const
*/
void KateTabBar::updateFixedHeight()
{
- setFixedHeight(tabHeight());
+ setFixedHeight(m_tabHeight);
triggerResizeEvent();
}
diff --git a/kate/app/katetabbar.h b/kate/app/katetabbar.h
index 6577b2c..36745a2 100644
--- a/kate/app/katetabbar.h
+++ b/kate/app/katetabbar.h
@@ -70,9 +70,6 @@ public:
int minimumTabWidth() const;
int maximumTabWidth() const;
- void setTabHeight(int height_pixel);
- int tabHeight() const;
-
int addTab(const QString &text);
int addTab(const QIcon &pixmap, const QString &text);
void removeTab(int index);
diff --git a/kate/app/katetabbutton.cpp b/kate/app/katetabbutton.cpp
index 83bd2f1..efabb19 100644
--- a/kate/app/katetabbutton.cpp
+++ b/kate/app/katetabbutton.cpp
@@ -44,7 +44,6 @@ KateTabButton::KateTabButton(const QString &caption,
setFocusPolicy(Qt::NoFocus);
setMinimumWidth(1);
setFlat(true);
-// setAutoFillBackground(true);
m_buttonId = button_id;
m_modified = false;