Commit graph

6 commits

Author SHA1 Message Date
Tobias Hunger
63f7533dc9 compiler: Fix identifier normalization function
`__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.
2025-05-21 12:21:20 +02:00
Tobias Hunger
83c2bdd54c
interpreter: Support gradients in JSON conversion (#7913)
* 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>
2025-03-21 16:24:45 +01:00
Tobias Hunger
2b59df1355 live-preview: Simple Data edit mode
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.
2025-02-20 09:43:24 +01:00
Yuri Astrakhan
5356fdcf89 Fix clippy issues, plus a few manual cleanups
* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Yuri Astrakhan
61de4d56b0 Fix all format arg inlining
Ran this command:

```shell
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-06 10:16:20 +01:00
Tobias Hunger
ded82cbb62 interpreter: Add JSON encoding/decoding for the interpreter values
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.
2025-02-04 13:06:40 +01:00