Based on API review, PlatformBuilder becomes BackendSelector with
a slightly smaller API surface but more options, such as selecting
Metal or Vulkan rendering.
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.
ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.
Closes#6047
When a box shadow is the only child of an opacity item, we don't create an intermediate opacity layer (good). Without the opacity layer, it's mandatory to apply the current opacity though, which commit b5c61fb2f5 did, except
it missed this one draw_image call for the box shadow itself.
Fixes#6359
After the FontMgr changes in the previous Skia update we can't default
construct Font anymore. Let's use the same default font we also use for
regular text then.
Fixes#5764
Combining an EGL config with EGL_ALPHA_SIZE == 8 with an Xrgb8888 surface yields a bad match on eglCreateWindowSurface.
That's fair, and we should accomodate for that by avoiding such EGL configs.
On Wayland hiding a window requires destroying the surface, which
means destroying the winit window as well as the underlying graphics
surface. The latter is tricky as we have to keep the renderer around,
as our WindowAdapter trait's `renderer()` function returns a `&dyn
Renderer` and that also has to work without a window (to obtain text
metrics).
Fixes#4225
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
- The cfg_aliases crate does it out of the box already
- Don't create a build.rs for this only purpose when it can be added in
Cargo.toml lints group. (This wasn't possible when the warning was
first introduced in nightly)
With the new winit, we end up calling resumed() and thus set_window_handle() multiple times - the first time right in the WinitWindowAdapter constructor. This may lead to the following sequence:
1. resumed() calls set_window_handle() the first time.
2. A frame gets rendered (odd, but yeah), we invoke the rendering notifier with RenderingState::RenderingSetup.
3. winit calls resumed(), we call set_window_handle() once more. We reset the surface.
4. The next time a frame gets rendered, we invoke the rendering notifier with RenderingSetup again.
There are a few things wrong, but first and foremost, in step 3 we should call RenderingTeardown if we've called RenderingSetup before.
This adds a new wrapping mode called `char-wrap`, which allows for wrapping at any character.
Currently, it only supports the Qt backend, with the other backends falling back to `word-wrap` when this option is selected.
Some versions use the zwp_linux_explicit_synchronization_v1 protocol
and end up re-allocating a synchronization object when initialzing an
EGL context on a surface a second time, causing the process to abort.
As a counter-measure, destroy the entire EGL context/surface/etc. before
creating a new one when on startup we call resume() after commit 518681cc02
Commit 1e450abc9c originally fixed this. Meanwhile, after many refactorings, this doesn't work anymore for the FemtoVG renderer. That's because the contents placement (or layer's contents gravity) is set before the hidden layer NSOpenGLContext creates is associated with the view.
For the Skia GL surface that already works, but for clarify the code is moved into the same location.
For Skia Metal rendering, apply the same on the metal layer (through the view). For this to work the contents scale also needs to be applied. To avoid further visual effects, the scale needs to be applied as early as possible, so apply it right after creating the
surface and latest at rendering time.
Fixes#5258