From d1d661a1858e28befe5980c22009702f5ea82829 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 5 Oct 2009 10:01:44 +0200 Subject: Disable etched text on rich text labels When rendering etched text on disabled rich text labels we would previously draw distorted links. This is basically because anything that did not render with the text foreground role would be drawn twice as a shadow. Since there is no way to properly render this text etched we will rather disable it completely when the label uses rich text. Task-number: QTBUG-4543 Reviewed-by: Simon Hausmann --- src/gui/widgets/qlabel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 5ba0571..3d908a1 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -1000,8 +1000,10 @@ void QLabel::paintEvent(QPaintEvent *) d->ensureTextLayouted(); QAbstractTextDocumentLayout::PaintContext context; - - if (!isEnabled() && style->styleHint(QStyle::SH_EtchDisabledText, &opt, this)) { + if (!isEnabled() && !d->control && + // We cannot support etched for rich text controls because custom + // colors and links will override the light palette + style->styleHint(QStyle::SH_EtchDisabledText, &opt, this)) { context.palette = opt.palette; context.palette.setColor(QPalette::Text, context.palette.light().color()); painter.save(); -- cgit v0.12