summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 8f99d6ad26..95ebdb4662 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -223,16 +223,13 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
--yy;
}
if (!(opt->state & State_Enabled) && !(opt->state & State_On)) {
- int pnt;
- p->setPen(opt->palette.highlightedText().color());
- QPoint offset(1, 1);
- for (pnt = 0; pnt < a.size(); ++pnt)
- a[pnt].translate(offset.x(), offset.y());
+ p->save();
+ p->translate(1, 1);
+ p->setPen(opt->palette.light().color());
p->drawLines(a);
- for (pnt = 0; pnt < a.size(); ++pnt)
- a[pnt].translate(offset.x(), offset.y());
+ p->restore();
}
- p->setPen(opt->palette.text().color());
+ p->setPen((opt->state & State_On) ? opt->palette.highlightedText().color() : opt->palette.text().color());
p->drawLines(a);
break; }
case PE_Frame:
@@ -919,6 +916,7 @@ static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth)
return QSizeF(widthUsed, height);
}
+
void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewItemV4 *option, const QRect &rect) const
{
Q_Q(const QCommonStyle);
@@ -936,7 +934,7 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt
textLayout.setFont(option->font);
textLayout.setText(option->text);
- QSizeF textLayoutSize = viewItemTextLayout(textLayout, textRect.width());
+ viewItemTextLayout(textLayout, textRect.width());
QString elidedText;
qreal height = 0;