`__1` is a valid identifier, which we normalized to
`--1`, which is invalid.
This changes the nromalization function to leave a `_` in the first position.
* interpreter: Support gradients in JSON conversion
Add gradients to the list of types that can be read from
JSON and serialized to JSON.
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
We can now set all the properties exposed to the
business logic of a UI we are previewing.
Simple properties only so far, everything else falls
back to JSON data.
Next step is to add more sophisticated UI to actually
edit more complex data like arrays more graphically.
Extract the `from_json` and `to_json` code from the viewer into the `interpreter`.
Extend the `from_json` and `to_json` a bit. Add some simple tests while at it.