Fix pushbutton text

BUG: 192988

svn path=/trunk/KDE/kdelibs/; revision=1136786
This commit is contained in:
Nicolas Lécureuil 2010-06-10 18:05:00 +00:00
parent 35e856e4de
commit c40ea8e691

View File

@ -419,8 +419,14 @@ void PushButton::paint(QPainter *painter,
widgetFont = Plasma::Theme::defaultTheme()->font(Plasma::Theme::DefaultFont);
}
//if there is not enough room for the text make it to fade out
QFontMetricsF fm(widgetFont);
// If the height is too small increase the Height of the button to shall the whole text #192988
if (rect.height() < fm.height()) {
rect.setHeight(fm.height());
rect.moveTop(boundingRect().center().y()-rect.height()/2)
}
// If there is not enough room for the text make it to fade out
if (rect.width() < fm.width(nativeWidget()->text())) {
if (bufferPixmap.isNull()) {
bufferPixmap = QPixmap(rect.size().toSize());