From 688602704d5c5226491b0d0ab7f596f9568966d6 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 6 May 2021 21:13:29 +0200 Subject: [PATCH] Support CSS text-decoration-color in underlines, overlines, strikethrough Also add a feature to the textedit example to set this value. [ChangeLog][QtGui][CSS] The CSS text-decoration-color attribute is now supported in rich text spans with underlines, overlines and strikethrough. Fixes: QTBUG-82114 Task-number: QTBUG-39617 Change-Id: I0065cb5431833da55b0f503ce7ff2b83b74b718a Reviewed-by: Allan Sandfeld Jensen --- .../textedit/images/mac/textundercolor.png | Bin 0 -> 6916 bytes .../textedit/images/win/textundercolor.png | Bin 0 -> 6916 bytes examples/widgets/richtext/textedit/textedit.cpp | 15 +++++++++++++++ examples/widgets/richtext/textedit/textedit.h | 2 ++ examples/widgets/richtext/textedit/textedit.qrc | 2 ++ src/gui/painting/qpainter.cpp | 6 ++++++ src/gui/text/qcssparser.cpp | 1 + src/gui/text/qcssparser_p.h | 1 + src/gui/text/qtextdocument.cpp | 5 +++++ src/gui/text/qtextformat.cpp | 9 +++++---- src/gui/text/qtexthtmlparser.cpp | 1 + 11 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 examples/widgets/richtext/textedit/images/mac/textundercolor.png create mode 100644 examples/widgets/richtext/textedit/images/win/textundercolor.png diff --git a/examples/widgets/richtext/textedit/images/mac/textundercolor.png b/examples/widgets/richtext/textedit/images/mac/textundercolor.png new file mode 100644 index 0000000000000000000000000000000000000000..30e24e61c33adc516bf72e4c2e809c7305e5d3e2 GIT binary patch literal 6916 zcmeHMc|4R`A0Jn;m8GPO8iOn~X67+_MwTH&No1E~#o!+nUbHR;3-kDdkSd@c%S( zW$@Es$9mkYYCGPO_JL%dyyk%2^C2Z4*M@auzIaSo?NQUsh(ap`CcN-{)cSEoD1@c& zsamy7EIH6-y7k92z4=M$VHfQ*>Ji!U$Po#pm)1vQ&u4JnyTuxCv!3$rp4;YA(b>K| zDgGnu{X9jw_)=V@1(tDqL#9%bBD`bk&9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>Tz|L-lSbzT2`C5z)DHjMKTd#+%^&do{4Xj%dZ2`~02D?KjpA@nU-#e( z%=SYdUmW_MJ^1#}1{`Gv^0`4g257b)^cSdq4YA$Q#`X^c5hX7+Ct#5jB;GfJF&Tf@ z1qAW@7Hyae6zB(XAW%N!ALbi-0h{%wSl{?2YFVW7wIk4Qf8c*({X6$XW5~+JhD_x$ zf<%K_QYi?Lzhowt!Df;dZ|P_>7N8RWB%MZJBC&Kj7D*(MNJxDgzyet$Jb(wVUqM;= z^93}21}K7p!1dS=4i<}H(J(9=63@UAkXQl(gCvsBXe0|qWU#O}Jf6rxe+99N$A+?! z=J&N%A}A&Vg+T)h7KWscWMDxC5(@$>B%OexAwdvLW1#gJ7&M->2qlUG+1S>Sf&lbB zgD=+D`q2a|E{{V&ShM|ugnydavpL`%0Zk+t1`nY1_0d=&fq=tf379{P_JTY`N27WGmo&tXC#U?m>F>T2-#^*u!wEZA+aUiJQ z=O%_X&EE@z=J%I``n{h0KZ1qU$It%F;h0d|N#COL zxhz32jRzWgK};bwPy#Kofom^ntn;mPus0|Y5Dj3EXdDuaw+Ap}087RYH=_YE8jV2x z^ArILpbyX)OeCHT(vesio{l78pyvz|qYvOg3>}BV1K&FRw@}0q{(ls4BoK#ZLa}4e zXm}(R1K=Tw`XnTSj-%sh@yD4IcWb}VT(Eue{etw^t2B`mJT(5n5g_RAgZw3ZzsvPquD_(fUo!rlUEk&UOA7oY=agTtd|XDo6)dIP+mJ*_EP8 z43?HIdIu#bu(UCg9F$nP5-mwg+DV0~j4i3g_S#Pwp63Bis>FpA(}@+*ZO+b4XCl`` z5&Qa8e)wTt3J$N3Na-CI92)BDi-vi4=qX(|V+`|FS}&>P;VagnAg&!~tZ4&*!7R;o KQVUHyqy7!MI;dU% literal 0 HcmV?d00001 diff --git a/examples/widgets/richtext/textedit/images/win/textundercolor.png b/examples/widgets/richtext/textedit/images/win/textundercolor.png new file mode 100644 index 0000000000000000000000000000000000000000..30e24e61c33adc516bf72e4c2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u(UCg9F$nP5-mwg+DV0~j4i3g_S#Pwp63Bis>FpA(}@+*ZO+b4XCl`` z5&Qa8e)wTt3J$N3Na-CI92)BDi-vi4=qX(|V+`|FS}&>P;VagnAg&!~tZ4&*!7R;o KQVUHyqy7!MI;dU% literal 0 HcmV?d00001 diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp index 3a1b3321a12..ed91f6e2503 100644 --- a/examples/widgets/richtext/textedit/textedit.cpp +++ b/examples/widgets/richtext/textedit/textedit.cpp @@ -354,6 +354,10 @@ void TextEdit::setupTextActions() actionTextColor = menu->addAction(pix, tr("&Color..."), this, &TextEdit::textColor); tb->addAction(actionTextColor); + const QIcon underlineColorIcon(rsrcPath + "/textundercolor.png"); + actionUnderlineColor = menu->addAction(underlineColorIcon, tr("Underline color..."), this, &TextEdit::underlineColor); + tb->addAction(actionUnderlineColor); + menu->addSeparator(); const QIcon checkboxIcon = QIcon::fromTheme("status-checkbox-checked", QIcon(rsrcPath + "/checkbox-checked.png")); @@ -729,6 +733,17 @@ void TextEdit::textColor() colorChanged(col); } +void TextEdit::underlineColor() +{ + QColor col = QColorDialog::getColor(Qt::black, this); + if (!col.isValid()) + return; + QTextCharFormat fmt; + fmt.setUnderlineColor(col); + mergeFormatOnWordOrSelection(fmt); + colorChanged(col); +} + void TextEdit::textAlign(QAction *a) { if (a == actionAlignLeft) diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h index 07a307f83db..debc401150c 100644 --- a/examples/widgets/richtext/textedit/textedit.h +++ b/examples/widgets/richtext/textedit/textedit.h @@ -95,6 +95,7 @@ private slots: void textSize(const QString &p); void textStyle(int styleIndex); void textColor(); + void underlineColor(); void textAlign(QAction *a); void setChecked(bool checked); void indent(); @@ -125,6 +126,7 @@ private: QAction *actionTextUnderline; QAction *actionTextItalic; QAction *actionTextColor; + QAction *actionUnderlineColor; QAction *actionAlignLeft; QAction *actionAlignCenter; QAction *actionAlignRight; diff --git a/examples/widgets/richtext/textedit/textedit.qrc b/examples/widgets/richtext/textedit/textedit.qrc index 1641acc207a..a30d50fdbfd 100644 --- a/examples/widgets/richtext/textedit/textedit.qrc +++ b/examples/widgets/richtext/textedit/textedit.qrc @@ -22,6 +22,7 @@ images/mac/textleft.png images/mac/textright.png images/mac/textunder.png + images/mac/textundercolor.png images/mac/zoomin.png images/mac/zoomout.png images/win/checkbox.png @@ -45,6 +46,7 @@ images/win/textleft.png images/win/textright.png images/win/textunder.png + images/win/textundercolor.png images/win/zoomin.png images/win/zoomout.png example.html diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 38ce9bf604b..01400a0bc86 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6061,6 +6061,9 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const if (flags & QTextItem::StrikeOut) { QLineF strikeOutLine = line; strikeOutLine.translate(0., - fe->ascent().toReal() / 3.); + QColor uc = charFormat.underlineColor(); + if (uc.isValid()) + pen.setColor(uc); painter->setPen(pen); if (textEngine) textEngine->addStrikeOut(painter, strikeOutLine); @@ -6071,6 +6074,9 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const if (flags & QTextItem::Overline) { QLineF overline = line; overline.translate(0., - fe->ascent().toReal()); + QColor uc = charFormat.underlineColor(); + if (uc.isValid()) + pen.setColor(uc); painter->setPen(pen); if (textEngine) textEngine->addOverline(painter, overline); diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 46ed67ea7dc..4cc310c7e72 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -166,6 +166,7 @@ static const QCssKnownValue properties[NumProperties - 1] = { { "subcontrol-position", QtPosition }, { "text-align", TextAlignment }, { "text-decoration", TextDecoration }, + { "text-decoration-color", TextDecorationColor }, { "text-indent", TextIndent }, { "text-transform", TextTransform }, { "text-underline-style", TextUnderlineStyle }, diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index 1ccfc45d21c..56af5c8bb2c 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -201,6 +201,7 @@ enum Property { QtIcon, LetterSpacing, WordSpacing, + TextDecorationColor, NumProperties }; diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 2c0c3582ed5..d3bec57bd4c 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2560,6 +2560,11 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format) if (!atLeastOneDecorationSet) html += QLatin1String("none"); html += QLatin1Char(';'); + if (format.hasProperty(QTextFormat::TextUnderlineColor)) { + html += QLatin1String(" text-decoration-color:"); + html += colorValue(format.underlineColor()); + html += QLatin1Char(';'); + } attributesEmitted = true; } else { html.chop(decorationTag.size()); diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 44986c337c9..80c7845410e 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -642,7 +642,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt) \omitvalue FirstFontProperty \omitvalue LastFontProperty - \value TextUnderlineColor + \value TextUnderlineColor Specifies the color to draw underlines, overlines and strikeouts. \value TextVerticalAlignment \value TextOutline \value TextUnderlineStyle @@ -1984,8 +1984,8 @@ QStringList QTextCharFormat::anchorNames() const /*! \fn void QTextCharFormat::setUnderlineColor(const QColor &color) - Sets the underline color used for the characters with this format to - the \a color specified. + Sets the color used to draw underlines, overlines and strikeouts on the + characters with this format to the \a color specified. \sa underlineColor() */ @@ -1993,7 +1993,8 @@ QStringList QTextCharFormat::anchorNames() const /*! \fn QColor QTextCharFormat::underlineColor() const - Returns the color used to underline the characters with this format. + Returns the color used to draw underlines, overlines and strikeouts + on the characters with this format. \sa setUnderlineColor() */ diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index a242d5e6459..3ad0938268a 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1346,6 +1346,7 @@ void QTextHtmlParserNode::applyCssDeclarations(const QList &d default: break; } break; + case QCss::TextDecorationColor: charFormat.setUnderlineColor(decl.colorValue()); break; case QCss::ListStyleType: case QCss::ListStyle: setListStyle(decl.d->values);