GNOME Bugzilla – Bug 651940
"use-markup" is ignored when set after "text"?
Last modified: 2011-09-07 12:01:19 UTC
When I'm creating a ClutterText from a json file with { "type": "ClutterText", "use-markup": true, "text": "<b>Editor</b>" } the text displayed is "<b>Editor</b>" but while using { "type": "ClutterText", "text": "<b>Editor</b>", "use-markup": true } it does works and displays a bold "Editor". I'm guessing this is due to the ordering the properties are applied to the ClutterText, and potentially the text is not re-rendered if you set "use-markup" after "text"?
Created attachment 195775 [details] [review] text: Make :use-markup set idempotent Setting :use-markup and :text is currently not idempotent, and it depends on the ordering, e.g.: g_object_set (actor, "use-markup", TRUE, "text", value, NULL); does not yield the same results as: g_object_set (actor, "text", value, "use-markup", TRUE, NULL); This is particularly jarring when using ClutterText from ClutterScript, but in general GObject properties should not rely on the order when used from g_object_set(). The fix is to store the contents of the ClutterText as a separate string from the displayed text, and use the contents, instead of the displayed text, when toggling the :use-markup property. Let's also add a unit test for good measure, to try and catch regressions.
Attachment 195775 [details] pushed as 0bd1e47 - text: Make :use-markup set idempotent