summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-10-05 10:01:44 +0200
committerJens Bache-Wiig <jbache@trolltech.com>2009-10-05 10:05:56 +0200
commitd1d661a1858e28befe5980c22009702f5ea82829 (patch)
tree9dd9583d3dabb45bd5594578f4964026240896b2
parent7655e27047790d89f9af0132946ad5db5138e7bf (diff)
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
-rw-r--r--src/gui/widgets/qlabel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 5ba0571507..3d908a160b 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();