Commit 7c1f57c5 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Nate Graham
Browse files

[Notifications] Set Plasma linkColor on notification label

There's no API to set `linkColor` on `TextEdit` and it would use the
system link color potentially clashing with the Plasma theme.

BUG: 438366
FIXED-IN: 5.22.3

(cherry picked from commit a3734c74)
parent b018181a
......@@ -236,7 +236,12 @@ ColumnLayout {
Layout.maximumHeight: notificationItem.maximumLineCount > 0
? (theme.mSize(font).height * notificationItem.maximumLineCount) : -1
text: notificationItem.body
// HACK RichText does not allow to specify link color and since LineEdit
// does not support StyledText, we have to inject some CSS to force the color,
// cf. QTBUG-81463 and to some extent QTBUG-80354
text: "<style>a { color: " + PlasmaCore.Theme.linkColor + "; }</style>" + notificationItem.body
// Cannot do text !== "" because RichText adds some HTML tags even when empty
visible: notificationItem.body !== ""
onClicked: notificationItem.bodyClicked(mouse)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment