There is only one directory alled "ui", so there isn't really need to have
this level of directory.
This aligns with other demo that don't have any source files
Also rename appwindow.slint to dial.slint
Use the entire screen-space (minus borders) when the preferred size
of a UI is 0 and we are asking to reset to the preferred size.
I was reluctant to implement this before as I think it is surprising
to start with a huge size when the size info is most likely wrong...
People typically render outside the component's area in that case.
Now that we clip away anything that is not inside the UI area, I think
this is discoverable enough now: When resizing you will see the UI
getting clipped after all.
The big size also avoids confusion when nothing shows up :-)
* live-preview: Polish the header-view
* live-preview: Clean up the previous patch a bit
---------
Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
Clip anything the previewed UI wants to draw outside
of the area the previewed component claims to be using.
There are several reasons to do this:
* A window will clip the contained component
* Selection outside of the area taken up by the
root component can not be selected or interacted
with
* It is more obvious that you are doing something
wrong when your UI is clipped. Before we happily
showed the right thing in the preview and then
failed hard when using that component.
This means that, when the parent is not a layout, the widgets are
always dropped in the middle of the parent, and then one can place
place it to the right position.
In particular, for widget that expaneds to the size of their parent by
default, this does the right thing
Fixes#6098
We did not have the compile-test infrastructure when
implementing the addition of new components into a UI. Use that
infrastructure, it catches some places where we can not actually
drop into that the previous heuristic missed.
Otherwise we end up with values such as
```slint
SpinBox {
minimum: 0;
value: 42;
maximum: 100;
x: 94.44821px;
y: 108.07013px;
}
```
Which doesn't make much sense
This is consistant so that `width: 100%` is the same as `width: parent.width`
This basically revert the previous commit that was just working around
the debug_assert to actually fix the behavior
ChangeLog: width and height expressed in `%` unit for an element in a
Flickable now refer to the size of the Flickable instead of that of
the viewport
The viewport of a flickable is of ElementType::Native, and `lookup_property`
don't query the builtin reserved properties in that case.
This commit fix the assert by allowing Type::Invalid as well.
Fixes#4163
Run the nightly esp-idf test against the esp-idf slint nightly
binaries, after creating them. The snapshot is run earlier as well
then, so that the tests don't "leak" into the morning working hours.
For example, running the viewer with a DISPLAY wrongly set:
Before the patch:
```
thread 'main' panicked at tools/viewer/main.rs:123:32:
called `Result::unwrap()` on an `Err` value: Other("Could not initialize backend.\nError from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit\nError from LinuxKMS backend: Timeout while waiting to activate session\nNo backends configured.")
stack backtrace:
[...]
```
If just using `?` instead of `.unwrap()`:
```
Error: Other("Could not initialize backend.\nError from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit\nError from LinuxKMS backend: Timeout while waiting to activate session\nNo backends configured.")
```
If using an wrapper that uses Display for Debug
```
Error: Could not initialize backend.
Error from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit
Error from LinuxKMS backend: Timeout while waiting to activate session
No backends configured.
```
Puts a shared biome.json in the root.
Deletes the prettier config files.
Deletes the unused pre-commit hooks.
Applies biome linting and formatting to the slintpad project.