summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-10-05 08:01:44 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-10-05 08:05:56 (GMT)
commitd1d661a1858e28befe5980c22009702f5ea82829 (patch)
tree9dd9583d3dabb45bd5594578f4964026240896b2 /src
parent7655e27047790d89f9af0132946ad5db5138e7bf (diff)
downloadQt-d1d661a1858e28befe5980c22009702f5ea82829.zip
Qt-d1d661a1858e28befe5980c22009702f5ea82829.tar.gz
Qt-d1d661a1858e28befe5980c22009702f5ea82829.tar.bz2
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
Diffstat (limited to 'src')
-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 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();