re enable fading for long text labels

svn path=/trunk/KDE/kdelibs/; revision=1128895
This commit is contained in:
Marco Martin 2010-05-20 15:49:05 +00:00
parent 1307855db1
commit 3f6a5ac01a

View File

@ -287,15 +287,12 @@ void Label::paint(QPainter *painter,
QWidget *widget) QWidget *widget)
{ {
QGraphicsProxyWidget::paint(painter, option, widget); QGraphicsProxyWidget::paint(painter, option, widget);
/*
NOTE: if we don't get any coplaints about "unitialized random gibberish" as in the FIXME
below, then we can just get rid of this entire block of code.it really depends on whether
or not Qt has been fixed since this was written
QLabel *native = nativeWidget(); QLabel *native = nativeWidget();
QFontMetrics fm = native->font(); QFontMetrics fm = native->font();
//FIXME: using QGraphicsProxyWidget::paint directly with opacity<1 produces uninitialized random gibberish //indirect painting still used for fade out
if (qFuzzyCompare((qreal)1.0, opacity()) && (native->wordWrap() || native->text().isEmpty() || size().width() >= fm.width(native->text()))) { if (native->wordWrap() || native->text().isEmpty() || size().width() >= fm.width(native->text())) {
QGraphicsProxyWidget::paint(painter, option, widget); QGraphicsProxyWidget::paint(painter, option, widget);
} else { } else {
const int gradientLength = 25; const int gradientLength = 25;
@ -332,7 +329,6 @@ void Label::paint(QPainter *painter,
buffPainter.end(); buffPainter.end();
painter->drawPixmap(contentsRect(), buffer, buffer.rect()); painter->drawPixmap(contentsRect(), buffer, buffer.rect());
} }
*/
} }
void Label::changeEvent(QEvent *event) void Label::changeEvent(QEvent *event)