Thursday, 2024-01-18

direc85[m]How could I use the `<a>` color that `Text.RichText` uses in `Text.StyledText`? There probably are some defined colors somewhere, but I can't find anything from the documentation... `color: inherit` just gives me black text, which is obviously not correct...19:46
direc85[m]Or how could I use theme-based colors in label using Text.StyledText?19:47
direc85[m](I think I got those the wrong way around, but you get the picture)19:48
attahdirec85[m]: stackoverflow suggests either QPalette QPalette::Link/QPalette::LinkVisited, or a <span> n the <a>19:50
attahHmm, i think i misunderstood, but accidentally almost answered anyway19:53
attahAssuming current QPalette can be gotten and read19:53
direc85[m]https://together.jolla.com/question/4726/link-color-in-richtext-qml-label/19:59
direc85[m]https://doc.qt.io/qt-6/qml-qtquick-text.html#linkColor-prop20:01
direc85[m]Okay, I think I have a workaround now...20:01
attahhttps://stackoverflow.com/questions/5497799/how-do-i-customise-the-appearance-of-links-in-qlabels-using-style-sheets20:01
attahI think QPalette looks attractive, if it's supposed to be app-global20:02
direc85[m]The solution I went with is adding a property inside the Label element `property string cssStyle: "<style> a { color: " + linkColor + " } </style>"` and prefixing the wanted text with that text. It makes the element even responds to theme changes!20:43
direc85[m]Feel free to use :)20:46

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!