Start the live preview in a separate process. This simplifies
a couple of things:
* Starting the UI
* UI state handling
* Threading setup
* "Quitting" the preview on Mac
... and many more :-)
When asked to drop a document, don't make it a fatal error. Also, when the conversion fails for loading or closing, print the path to stderr. Maybe we can learn something there.
cc #8089
cc #7333
cc #4926
live-preview: Improve std-widget use detection
... so we do not hide the Style combobox when std-widgets get used by
imported components, even if they are not used by the previewed
component.
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
This is a hacky approach, but does help a lot with the tedious fixes.
See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or
```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or
cargo fmt --all
```
The change in https://github.com/slint-ui/slint/pull/6747
invalidated the cache, but it was only reloaded when one of the dependent was reloaded.
We need to reload the cache for all open file so that LSP feature continue to work on
open document even if they get no changes
This removes a lot of allocations and speeds up the compiler step
a bit. Sadly, this patch is very invasive as it touches a lot of
files. That said, each individual hunk is pretty trivial.
For a non-trivial real-world example, the impact is significant,
we get rid of ~29% of all allocations and improve the runtime by
about 4.8% (measured until the viewer loop would start).
Before:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 664.2 ms ± 6.7 ms [User: 589.2 ms, System: 74.0 ms]
Range (min … max): 659.0 ms … 682.4 ms 10 runs
allocations: 4886888
temporary allocations: 857508
```
After:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 639.5 ms ± 17.8 ms [User: 556.9 ms, System: 76.2 ms]
Range (min … max): 621.4 ms … 666.5 ms 10 runs
allocations: 3544318
temporary allocations: 495685
```
When no bindings exist on the component, the value that is shown in the
property editor should be the default value for that property as defined
in the base component or in the builtin element. Not just the default
value of the type
I got carried away, I replaced `u32` with `TextSize` in one place
because that's what I got and I did not want to convert... and
then I fixed the fallout.
No functional change is intended in any of this.
FIXUP