We have moved to a new Sailfish OS Forum. Please start new discussions there.
2

Link color in RichText Qml Label [answered]

asked 2013-12-28 15:24:26 +0300

Khertan gravatar image

Currently link in a RichText QML Component Label are displayed with a dark blue color, this didn't integrate well with the other component, but this could be unreadeable with some ambiances.

The question has been closed for the following reason "the question is answered, an answer was accepted" by Khertan
close date 2014-01-11 09:28:20.993312

add a comment

2 Answers

Sort by » oldest newest most voted
5

answered 2013-12-28 15:55:14 +0300

Tanghus gravatar image

You can add css to the text value:

Label {
    textFormat: Text.RichText;
    text: "<style>a:link { color: " + Theme.highlightColor + "; }</style>" +
          "<a href=https://together.jolla.com/'>Jolla2Gether</a>";
    }
}
link

Comments

Thanks for the workarround

Khertan ( 2013-12-28 21:16:36 +0300 )
add a comment
1

answered 2013-12-28 15:33:35 +0300

lbt gravatar image

See http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-text.html#linkColor-prop

This appears to be a limitation in Qt atm. You can work around it by including CSS which refers to the Theme.

Hmm I wonder if the default style can be linked to the Theme?

link
add a comment

Question tools

Follow
2 followers

Stats

Asked: 2013-12-28 15:24:26 +0300

Seen: 3,397 times

Last updated: Dec 28 '13