* Add scale method to backends
* Rename Rotate to Transform
* Add scaling to Transform
* Fix tests
* Insert Transform if any of scale-x, scale-y or rotation-angle are set
* Add scaling to child_transform and handle events as a result
* Cargo fmt
* Femtovg clipping
* Fix femotovg clipping
* Add newline to actual_render.scale
* Cargo fmt tools/lsp changes
* Modify docs
* Change type to a float instead of percent and fix defaults
* Add note about software renderer
* Add basic event scaling test
Resizing the window may cause a panic in wgpu. DebugView with d3d debug layers enabled yields a more elaborate message:
IDXGISwapChain::ResizeBuffers: Swapchain cannot be resized unless all outstanding buffer references have been released.
So before resizing, force Skia to submit and flush everything to the CPU level. This isn't optimal - especially since it's cross window - but it seems to work.
Fixes#9320
* Start on touch event rotation work
* [autofix.ci] apply automated fixes
* Use ItemTransform instead.
* [autofix.ci] apply automated fixes
* Use casts to deal with integer Coords on some platforms
* Remove rotation checks
* Transform the exit event as well
* Delete check_rotation pass
* Do casts around transform_point to handle i32 Coords
* Remove errors from rotation syntax test
* Basic event rotation test
Working changes
* Fix clicks on rotated objects
* Add RendererSealed::suppports_transformation for runtime checks
* [autofix.ci] apply automated fixes
* Add a few missing line breaks, only transform events if supported by
renderer
* Improve test
* Remove extra whitespace
* Get absolute-position working
* Ensure map_to_window does the coordinate cast thing.
* Manually test mouse-x and mouse-y, test absolute_position()
* Whitespace stuff again
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- For Skia, also opt out of the WGPU GL backend - we're not attempting to map it to Skia.
- For FemtoVG, avoid GL as well, because it produces artefacts.
... as we don't enable the Vulkan feature by default with skia on Windows, because it's not in the binaries and thus would force everyone to build skia (which is a PITA on Windows).
Set up the underlying graphics API with WGPU, render into the queue with
skia, present with WGPU. Opens path to importing wgpu textures, provided
that we synchronize them (i.e. pipeline barriers/transitions if needed).
After commit e04f028c91, the
default-font-size property on WindowItem isn't set anymore by default,
so BuiltinFunction::GetWindowDefaultFontSize, which reads it, would
return zero.
Instead, delegate to a run-time function where we can fall back to the
default from the renderer.
This patch changes rem.slint to use the newer syntax. The main change to
the test case though is to removal of the explicit default-font-size
property setting, so that we fall back to the value provided by the
renderer. This test relies on being run with the testing backend.
Fixes#8961
With Overflow::Elide, handle two cases:
- When word wrap is disabled, lay out with the given width, set the
elipsis character on the style
- When word wrap is enabled, lay out with the given width, don't set
elipsis on the style, *then* compute the correct number of max
lines, and re-do the layout - that way the elipsis appears on the
last line of the multi-line text
When computing the implicit height of a Text, we call text_size() on the renderer with the previously computed width, which in turns creates a text layout and *should* wrap text according to the width and return the height.
Before #8138, text layouts created with NoWrap were still wrapped and produce a height as if it were wrapped.
After #8138, NoWrap would return a height as if the text were on a single line. Unfortunately, the text_size() call used TextWrap::default() as wrap mode, which is NoWrap. That was previously an accidental no-op, but now isn't. So we need to pass TextWrap::WordWrap to get a reasonable height.
Fixes#9053
- Implement @conic-gradient(color angle, ...) syntax
- Center is always at rectangle center (no center_x/center_y parameters)
- 0 degrees starts at north (12 o'clock position)
- Support Slint angle units: deg, rad, turn
- Software renderer: Full native implementation
- Qt backend: Native support with angle offset correction
- Skia backend: Native support with angle offset correction
- FemtoVG backend: Fallback to solid color (first gradient stop)
ChangeLog: Added support for `@conic-gradient`
Fixes#3957
We had code on the window to reset the default-font-size property to the
default from the renderer.
For the Qt backend, the PopupWindow being their own Window, this code
was activated also for the PopupWindow's hidden default-font-size
property, which caused all PopupWindow's font to not follow the
default-font-size
Fixes#8855
- 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.
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
Python is missing, otherwise this builds windows arm64 binaries for the
tools, C++ packages, slint-compiler, npm binaries, and lsp binaries for
the VS code extension.
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.
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>
... 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
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
... using taplo with default settings
I tried this with 4 spaces indentation, but the patch is almost as
big as this one, so I went with default settings instead as that
is just easier:-)
We've had some reports like #7641 . Now that we enable partial rendering by default, let's default to software rendering for Skia on Windows, until perhaps the Skia dawn backend arrives.
Closes#7641
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
See https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::useless_format
cargo fmt --all
```
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.