To be compatible with the 2024 edition, we need to wrap the
`no_mangle` attribute in `unsafe()`.
The parsing for that in cbindgen was only added in the version 0.28,
but we couldn't upgrade cbindgen before because of a regression in
cbindgen 0.27 that prevented us from upgrading.
Now that cbindgen 0.29 is released with a fix, we can prepare for the
2024 edition
When either the viewport gets smaller or the Flickable gets bigger, we
should move the viewport position to keep it within the bounds.
Fixes#7487Fixes#2227
(Also workaround #8147 as the ScrollView will automatically go back in
bounds)
... 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
This is a hacky approach, but does help a lot with the tedious fixes.
See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or
```
__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::unnecessary_map_or
cargo fmt --all
```
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.
The downside is that there is a bit of churn in the tests
We shouldn't ungrab the mouse when the mouse distance is smaller than the threshold
Fixes#7152
ChangeLog: Fixed Flickable hard to scroll when starting slow
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
As requested in #1462, I've added a `flicked`-Callback that gets
triggered when the `viewport_x`- or `viewport_y` -Properties are changed
by a mouse drag or mouse wheel movement.
This will be needed for embedding - to avoid creating two window
adapters - and it will be needed for the API to allow creating a
component from an existing window.
So that we don't need to query the geometry multiple time, and this pave
the way to not have the geometry in the items
Part of #1932
As a drive by, fix the clipping of the Path element which incorrectly
offseted the clip by (x,y).
Similar fixes happen in the Clip element in some renderer, but that
didn't have effect because x and y are always 0 for the Clip element
When scrolling the printer demo, I often end up closing or opening
element i don't want to because we reached the end and therefore it is
not scrolling and forwarding the event
We need to continue propagating the release event to other element (eg
other flickable)
Fix the flickable flicking even though the mouse is released if there are
several Flickable in the component.
We already checked before that we can flick in that direction
(horizontally or vertically), but we did not check that we were not
actually at the end already.
This removes the special code for the generated property getters and
ensures type safety in the run-time library for property value setting.
In the Rust generated code we continue to do arithmetic on the scalar
values, that means we immediately extract the scalar, do arithmetic and
rely on the compiler to only allow compatible units.
Danger zone alert: In the interpreter Value::Number can now be converted
to LogicalLength as-is.
It was reported an annoying visual bug when flicking over a listview
with item that has a special effect on pressed, that the items would
show "pressed" for a brief instant. This patch add a small delay before
sending the press event to the children.
The FIXME in the test is not a regression. (This happens because we send
Exited event to the children when flicking, despite the mouse is still in
the area)
Added a update_timers_and_animations from slint_mock_elapsed_time so we
don't have to call update_timers_and_animations ourselves in the test
anymore to fire the timers (it was previously only touching the
animation property)
and use Rc<dyn PlatformWindow> instead. The alias has to stay with the ffi
functions though and the item vtable definitions,
because we don't have an Rc<> template in C++.