Instead, hide access to the string behind a RenderString trait.
The objective in the future is to cache the layout, which means that we need to query the text and other properties only if the cache is dirty.
As suggested in #9862 this PR adds support for FB Renderer Format DrmFourcc(BA24) in LinuxKMS.
Changelog: Added support for FB Renderer Format DrmFourcc(BA24) in LinuxKMS
Closes#9862
Instead of each caller obtaining the scale factor, the renderer can do that, too. This also eliminates the dependency to the scale factor where it's not needed, such as for the font metrics.
* Add `stroke-line-join` for `Path`
* Add `LineJoin` enum
* Add `stroke-line-join` property for `Path`
* Set line_join in Skia and FemtoVG renders
* Set pen_join_style in Qt backend
* Add example test case
* Docs: Add `stroke-line-join` property for `Path`
* Underscores and links
* Add color options
* Store links seperately
Gate the links field
* [autofix.ci] apply automated fixes
* Change fill_rectangle to use a brush instead
* Change if let to if is_some
* Fix skia
* Gate structs again
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
On any TCP communication errors between AUT and test server, do not
panic with unwrap() anymore but just close the connection and print
the error to stderr. So the application will not panic anymore when
the test server quits.
Reason is that the panic randomly happened during normal test execution,
probably during test shutdown phase. Even though the tests were
successful, on macOS a crash reporter dialog was raised due to the
panic, which is annoying. Fixing the panic will prevent the crash
reporter from unintentionally showing up.
Changelog: Added four new properties to the Window element for exposing the safe area to Slint and implement it for iOS.
Changelog: Adjust Android implementation of the window safe area to match the iOS implementation. This is a breaking change!
Fixes#9755
When building the muda menubar, we end up evaluating bindings, which in
case of access `Palette.color-scheme` invokes
BuiltinFunction::ColorScheme, which tries to borrow the
winit_window_or_none for winit::Window::theme() access. Fix this by
narrowing the borrow_mut() access window to winit_window_or_none and
construct the muda menubar afterwards.
Fixes#9792
We remove the menubar when the window looses the focus, but due to
https://github.com/rust-windowing/winit/issues/4371 we see spurious
deactivations. Let's just not remove the old menubar.
When switching between multiple top-level windows the activation of
the new menubar replaces the old.
Fixes#9770
AccessKit now make sure to only expose the placeholder text when necessary, ensuring it is not presented if the text input is not empty. Workarounds in .slint files can therefore be removed.
* slint: Add test for panic on popups vanishing
* core: Remove popups from the list of open popups
... when a popups parent component gets deleted.
* core: Handle a popup window vanishing while rendering
... using an ItemWeak instead of having an extra sentinel
parameter to pass around.
Also:
- The newer version of femtovg permits disabling text layouting, so this means less dependencies
- Skia is the only renderer left to support wgpu 26, so unstable-wgpu-26 now implies a dependency to renderer-skia
Closes#9605
This is supposed to be emitted whenever the user performs an
intentional interaction, which works whenever you scroll the Slint
Flickable with the scrollwheel. Dragging the scrollbar on the Qt
style didn't do anything, since that was never hooked up to this
callback.
I only implemented this in the Qt style, because that's the only
one that uses the NativeScrollView element.
See #9574.
This fixes a regression seen with 0910024aeb
where text outlines no longer rendered with Qt and the text color
was wrong in general.
It turns out drawGlyphRun doesn't work when drawing outlines. It
only uses the current QPen color and that's it - so not a built-in
way to draw the outlines separately. There was also another bug
where we weren't setting the correct QPen color, which regressed
any dark themes. (Presumably because no one expected it to fill
text with the QPen!)
We can fix this by only using drawGlyphRun for filling in glyphs.
For drawing the glyph outlines, we can skip the built-in QPainter
functions altogether and use QRawFont's ability to create
QPainterPaths for us. This restores the text to its previous
appearance while keeping the nicer text layouting!
- Replaced the previous `cfg_if` macro usage for detecting Apple platforms with a new `is_apple_platform` function in `lib.rs`, improving code readability
- Updated the `window_event` function in `event_loop.rs` to utilize the new `is_apple_platform` function for determining the `swap_cmd_ctrl` variable.
- Simplified the logic in `wasm_input_helper.rs` for checking if the platform is Apple by using the new function.
- Adjusted the `text_shortcut` method in `input.rs` to leverage the new platform detection, ensuring consistent behavior for keyboard shortcuts across Apple devices.
In a LineEdit with a long text, when dragging the selection
to the point where the anchor scrolls out of view in the other
direection, it used to keep being visible, outside the LineEdit.
This commit fixes that by passing the clip rect to the java code
that positions the selection handles.
* 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
It's nice that the default icon size comes from the style, but sometimes
the user wants a big button with a big icon.
Tested in all 5 styles, with PNG and SVG, with and without icon-size
set.
ChangeLog: Added `icon-size` property to Button
* 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>