The `require_wgpu_24` function accepts either a fully setup WGPU, or one
can configure individual aspects such as features/limits.
The wgpu_texture example uses this to add push constants to the required
features and thus eliminates the need for uniform buffers.
This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.
The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
```
warning: implicit autoref creates a reference to the dereference of a raw pointer
--> internal/interpreter/dynamic_type.rs:170:26
|
170 | let mem_layout = (*instance).type_info.mem_layout;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: creating a reference requires the pointer target to be valid and imposes aliasing requirements
= note: `#[warn(dangerous_implicit_autorefs)]` on by default
help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
|
170 | let mem_layout = (&(*instance).type_info).mem_layout;
| ++ +
```
Taking a reference to the type_info is valid because the instance is a
valid instance in that function
This is a hook for the Qt backend that provides the ability to access the `QWidget` for a window, similar to how the `winit` back end supports accessing the `winit` `Window` object
The code would fail to compile because the property would not be seen as
used and would be removed, but not the change callback.
Fixes#8269
Also fix a segfault in the added test because it will initialize the
change callback (and therefore query the properties) because the
SharedGlobal structure is fully initialized.
So we must only initialize the change callback on global after the
SharedGlobal is fully initialized
The main visible external change is that FemtoVGRenderer is now a generic type, but in the public Slint API the type alias that uses the OpenGL backend is re-exported under the old name. This looks a little different in rustdoc
but appears to be source compatible.
... by changing the resolution for the `WindowItem` to traverse the
item tree from the current item, instead of going to the window.
This doesn't quite fix#4298 because `rem` resolution is still missing.
That requires the built-in default font size function to be fixed as
well, which is non-trivial.
cc #4298
The layout pass needs to see when going over the layout, that these
properties are set. So inline the element that sets these properties if
they are not set in the base.
Fixes#8091
Conversion from negative float to unsigned is saturating to 0 in rust
and undefined behavior in C++, we should therefore handle the case
properly
Fixes#8222
Adding support for (optional) trailing commas like this:
import {
Foo,
Bar,
} from "foobar.slint";
This way it's more convenient to keep component imports sorted and
leads to smaller diffs when adding more components to the end of the
import statement.
ChangeLog: Allow trailing comma in import statements
Closes#4922
This is only exposed when internal types are exposed (such as in the lsp).
The plan is to make this public under a new name/global after the release.
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
In the test, `reexport.slint` depends on `bar.slint`
When parsing `reexport.slint` we shouldn't clear previously reported
error from previously parsed `bar.slint`. The errors are still there.
With a previous PR, I added a hook to enable the creation of a winit window, which necessitated accessing the winit event loop (https://github.com/slint-ui/slint/pull/7227). This hook was removed in `cd29bdd367` because the Slint event loop was moved to `SharedBackendData`.
I'm very open to the possibility that this is not the correct change, perhaps due to one or more of the following
- Making `shared_backend_data` public
- The `unwrap()` calls
- The possibility that exposing `with_event_loop()` may be a better solution
We try to only visit the bindings of used property.
The problem is that when we visit the element, not all properties have
been marked as used, yet. We have a chicken and egg problem.
So just visit all bindings even for property we haven't reached.
This is unfortunate that we have to do that, and we'd need a much
deeper analysis to do this properly.
Fixes#8144
By default it's enabled, of course. This property is not only added to
MenuItem, but Menu as well - since they can be nested. It's also
possible to select a disabled item, but it's hard to modify that since
it's logic is written in Slint. You should be prevented from activating
it with a tap or key press at least.
See #7791
This fixes the preview window not showing with the Qt backend,
because the preview uses a timer to show the window, but we would not
start the Qt timer and so the window was never shown
In the future, the plain winit::event_loop::EventLoop won't be usable for window creation anymore. There are two places where we need it:
1. From places where we also have access to the shared backend data.
2. From the top-level create_winit_window() function.
The latter we have to eliminate in the future, so might as well do it now and clean up to have one thread local less.
We were not visiting properly the MenuItem from
`recurse_elem_including_sub_components_no_borrow`
(`recurse_elem_including_sub_components` was correctly modified before)
Fixes#8090
The tree-sitter test fails because the output contained `ERROR` as it matched this string
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical
Add a .taplo.toml file
Also do not split feature array
You can not create this expression manually, but there
is a pass in the compiler that adds it to all set
properties in a compilation run.
All it does is basically associate an id with an expression,
so that we can then in a later step have the interpreter do
something with that information. Apart from that, it tries to
be as transparent as possible.
The LLR lowering removes that expression again, just so we can
be sure it does not end up in the generated live code.