Commit f1e82e3f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇 Committed by Volker Krause
Browse files

Use StyledText and set linkColor to text color

There's not really any need for elaborate HTML styling as provided
by RichText.

More importantly, though, this lets us easily (without adding
custom CSS) set linkColor to the text color. Currently, links use
the default blue color which can clash with the background quite harsh.

Since links are underlined, they are still marked.
parent 03b0265e
Pipeline #266713 passed with stage
in 1 minute and 43 seconds
......@@ -219,8 +219,9 @@ Item {
QQC2.Label {
Layout.fillWidth: true
color: pass.foregroundColor
linkColor: color
text: Util.textToHtml(modelData.valueDisplayString)
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.RichText : Text.AutoText
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.StyledText : Text.AutoText
wrapMode: Text.WordWrap
horizontalAlignment: modelData.textAlignment
onLinkActivated: Qt.openUrlExternally(link)
......
......@@ -225,8 +225,9 @@ Item {
QQC2.Label {
Layout.fillWidth: true
color: Util.isValidColor(pass.foregroundColor) ? pass.foregroundColor : Kirigami.Theme.textColor
linkColor: Util.isValidColor(pass.foregroundColor) ? color : Kirigami.Theme.linkColor
text: Util.textToHtml(modelData.valueDisplayString)
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.RichText : Text.AutoText
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.StyledText : Text.AutoText
wrapMode: Text.WordWrap
horizontalAlignment: modelData.textAlignment
onLinkActivated: Qt.openUrlExternally(link)
......
......@@ -185,8 +185,9 @@ Rectangle {
QQC2.Label {
Layout.fillWidth: true
color: Util.isValidColor(pass.foregroundColor) ? pass.foregroundColor : Kirigami.Theme.textColor
linkColor: color
text: Util.textToHtml(modelData.valueDisplayString)
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.RichText : Text.AutoText
textFormat: Util.isRichText(modelData.valueDisplayString) ? Text.StyledText : Text.AutoText
wrapMode: Text.WordWrap
horizontalAlignment: modelData.textAlignment
onLinkActivated: Qt.openUrlExternally(link)
......
Supports Markdown
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