- Use a version of FemtoVG that uses WGPU 25
- Rename the unstable-wgpu-24 feature and wgpu_24 module
- Fetch bevy from a revision on master branch that switches to WGPU 25
- Move the bevy example out of the common workspace: That way users of the repo don't get bevy pulled from git, unless they want to build the bevy example.
This adds an icon that is displayed to the left of the title, and is
also shown for Menus are inside of a parent menu.
Closes#7791
ChangeLog: Added icon property to MenuItem and Menu
Keep the error message in one line.
Error such as
```
Error: Error creating OpenGL display (Ok(
DisplayHandle(
Wayland(
WaylandDisplayHandle {
display: 0x00005641c528e590,
},
),
),
)) with glutin: not found
```
Are not easy to parse because of all the new lines
We convert constraints into physical sizes so that an overriding scale factor is applied, instead of the windowing system one. However, that breaks when the window isn't known yet *and* there's no overriding scale factor. Store window constraints and pending sizes as logical sizes first.
When applying to a window directly, convert to physical using our own scale factor. When applying on window creation, apply only an overriding scale factor, otherwise let winit apply the scale factor, because we don't know the final value only after window creation.
Fixes#8765Fixes#8736
This was fatal in previous released and still should be fatal. Otherwise failure will result in a silent perceived hang, as the event loop continues to spin.
This exposes FocusReason to .slint, and adds it as an argument to focus-event-changed callback on FocusScope to close#8387. It also adds two new callbacks, focus-gained and focus-lost, which are identical to focus-event-changed but are only invoked on focus gain or loss respectively.
In addition to this, it removes the FocusEventReason::AccessKit variant, replacing it with the mouse variant to hopefully make AccessKit more compatible with any Slint code that will use FocusEventReason.
Finally, I added two tests based on focus_change_event.slint, one for testing the FocusEventReason argument and another for testing the new callbacks.
close#8387
ChangeLog: Added `focus-gained` and `focus-lost` callback to FocusScope. Pass an `FocusReason` enum to the FocusScope callbacks
Closes#5992
Adds the enum FocusEventReason and makes it an argument for FocusEvent. This reason could eventually be exposed in Slint to solve #8387.
Using the focus reason tracking, I also added a select all on keyboard focus for TextInputs (except on macOS), which should close#5992.
ChangeLog: TextInput selects its content when focused with the keyboard on Windows and Linux
In this phase between the window being resized and receiving the resize event, the pending_requested_size variable tracks the value to be used in adjust_window_size_to_satisfy_constraints. Unfortunately,
it was never set.
Amends commit 1c73144b09.
Fixes#8452
Replace ios specific cfgs with "apple but not macOS", dubbed
ios_and_friends, so that we also cover iPadOS, etc.. What those have in
common is that they don't have user-resizable windows. (We might want to
add visionOs in the future)
Also, simplify a few macos or ios cfgs with just target_vendor =
"apple", for what applies to all the operating systems.
- When initializing the muda adapter, don't try to borrow from winit_window_or_none (how did this ever work?)
- When attempting to invoke the accesskit adapter, try to borrow winit_window_or_none. This may fail when updating the menu shadow tree (for which accessibility isn't handled by accesskit).
Amends 1c73144b09
In future versions of winit, it'll only be possible to create windows
when the active event loop signals availability. To upgrade to the latest
accesskit version as well as to run on iOS, we're going to implement support
for this earlier and stop using the deprecrated create_window() function
on the regular (not running) EventLoop.
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
Similar to the wgpu access, the `unstable-winit-030` feature exposes a
`slint::winit_030` module, which in turn re-exports `winit` but also
provides access to the `WinitWindowAccessor` trait. The
`BackendSelector` is extended to provide a way to hook into window
attribute creation as well as providing a custom event loop builder,
similar to what `i_slint_backend_winit::BackendBuilder` provides.
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>
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.
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
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.
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
In preparation for removing it altogether, remove the call to winit::platform::wayland::EventLoopExtWayland::is_wayland() with a matches!(winit_window.window_handle(), WindowHandle::Wayland(...))