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 |
attah | direc85[m]: stackoverflow suggests either QPalette QPalette::Link/QPalette::LinkVisited, or a <span> n the <a> | 19:50 |
attah | Hmm, i think i misunderstood, but accidentally almost answered anyway | 19:53 |
attah | Assuming current QPalette can be gotten and read | 19: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-prop | 20:01 |
direc85[m] | Okay, I think I have a workaround now... | 20:01 |
attah | https://stackoverflow.com/questions/5497799/how-do-i-customise-the-appearance-of-links-in-qlabels-using-style-sheets | 20:01 |
attah | I think QPalette looks attractive, if it's supposed to be app-global | 20: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/!