From 8d037b76736311d97a8f9c907a21508ccfa654f7 Mon Sep 17 00:00:00 2001 From: Christoph Feck Date: Thu, 7 Jan 2010 00:01:14 +0000 Subject: [PATCH] Use sizeHint() instead of pixelMetric() to get scroll bar size BUG: 194088 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1070887 --- src/TerminalDisplay.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 142050ad..d77fd63e 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -2708,8 +2708,7 @@ void TerminalDisplay::clearImage() void TerminalDisplay::calcGeometry() { - _scrollBar->resize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent), - contentsRect().height()); + _scrollBar->resize(_scrollBar->sizeHint().width(), contentsRect().height()); switch(_scrollbarLocation) { case NoScrollBar : @@ -2764,8 +2763,7 @@ void TerminalDisplay::makeImage() // calculate the needed size, this must be synced with calcGeometry() void TerminalDisplay::setSize(int columns, int lines) { - int scrollBarWidth = _scrollBar->isHidden() ? 0 : - style()->pixelMetric(QStyle::PM_ScrollBarExtent); + int scrollBarWidth = _scrollBar->isHidden() ? 0 : _scrollBar->sizeHint().width(); int horizontalMargin = 2 * DEFAULT_LEFT_MARGIN; int verticalMargin = 2 * DEFAULT_TOP_MARGIN;