- From C++, always call the Window::show() and hide() function instead
of going through set_visible directly as it doesn't set the size of
the WindowItem
- show() should also call resize on the renderer
- remove the is_visible in the WindowAdapterInternal as it is no longer
needed
Now that the SoftwareRenderer can be constructed, it is
finally possible to have your own WindowAdapter
Revert "Hide the `renderer()` function from the public API"
This reverts commit ff6653c77e.
Add a ComponentFactory type which will eventually be used as a property
value in Slint. The idea is to copy around this type and to create
components from it that we can embed.
We do not want to hand raw components around as those are reference counted
and might end up being embedded into several places, which would break out
tree of components.
Note: the addition of MinimalSoftwareWindow::set_size is there because
it would be a breaking change for user who called set_size on the
MinimalSoftwareWindow while also using the WindowAdapter trait.
This was the case of a test.
The same problem theorically exist with set_position and position, but
is unlikely to be a problem because i don't think people would use the
position with a MinimalSoftwareWindow
The renderer() is now public as well. That's because I want to make sure
that the scealed trait don't have non-provided method
- in SetRenderingNotifierError using a rustdoc link breaks the C++ docs. Using a qualified backtick'ed slint::Window works perfect with both.
- In TimerMode, the same track unfortunately doesn't work with a function,
but we can use [`Foo::bar()`] to make the link work with rustdoc and myst-parser.
The look isn't perfect in C++, the square brackets are visible.
After commit 7df902b53c, the winit window
is not created when calling show() anymore but it's now created at
component creation time. That means the event loop workaround removed
in 459f810bd8 is now needed at
construction time.
Since this is a winit and wasm specific issue, it's now dealt with in
the wasm interpreter implementation, by invoking the creation from the
event loop from there and returning a promise in the API.
This changes the API therefore: create() can only be called after the
event loop is running.
Add WindowEvent::ScaleFactorChanged and made set_scale_factor on
WindowInner private.
This achieves what #2486 tried to do, but using the clean platform
window event interface.
Add explicit enum values for repr(C) enums that have attributes like
cfg, so that even if there's a cfg gap in an enum (say cfg(feature =
"svg")) it won't break the ABI.
See also 004dce6c0b
Use a CStr instead of str, to avoid an extra CString allocation. The underlying operating system API for
this expects a zero terminated C String.
Fixes#1943