use the font for the fontmetrics that it's actually painting with

svn path=/trunk/KDE/kdelibs/; revision=1022199
This commit is contained in:
Aaron J. Seigo 2009-09-11 03:17:42 +00:00
parent 6dab30af74
commit a859eb502a

View File

@ -383,7 +383,7 @@ void PushButton::paint(QPainter *painter,
}
//if there is not enough room for the text make it to fade out
QFontMetricsF fm(QApplication::font());
QFontMetricsF fm(Plasma::Theme::defaultTheme()->font(Plasma::Theme::DefaultFont));
if (rect.width() < fm.width(nativeWidget()->text())) {
if (bufferPixmap.isNull()) {
bufferPixmap = QPixmap(rect.size().toSize());