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 +0200

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.

edit retag flag offensive reopen delete

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

2 Answers

Sort by » oldest newest most voted
5

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

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>";
    }
}
edit flag offensive delete publish link more

Comments

Thanks for the workarround

Khertan ( 2013-12-28 21:16:36 +0200 )edit
1

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

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?

edit flag offensive delete publish link more

Question tools

Follow
2 followers

Stats

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

Seen: 3,329 times

Last updated: Dec 28 '13