Trigger the `pointer-event` callback on mouse move. This is of "kind"
Move and the mouse button will always be `Other`, but at least the mappings
will be correct:-)
Closes: #2770
We have a nice FFI-compatible wrapper areound rust timers in C++, so
allow to use that in other types exported to C++.
This also makes sure the rust and C++ side agree on the size of the
type, with the nice side effect that the rust Timer now uses half as
much space now as it did before.
... after firing once. `running()` will now return `true` for such timers
till just before the callback is run and `false` after that point.
Add test a new test and update existing C++ tests to make them comply
with the changed behavior.
... for non-native PopupWindow.
We first need to handle the grabbed event regardless of popup window.
Then, if we are outside of the popup window, we should send exit events
so that, for example, the has-hover and mouse cursor get properly
updated.
Fixes#3934
The ComponentContainer is usually instentiated when trying to evaluate a
property such as the geometry or moving the focus. But the init code of
the ComponentContainer would then tries to change the focus which will
indirectly re-visit items and recurse into some property which are being
evaluated.
We do not need to set the focus on instentiation of the
ComponentContainer anyway, intentiating it shouldn't change the current
focus.
This fixes the LSP preview crashing when trying to preview a component
that has forward-focus
Fixes: #3950
We used to called borrow_mut twice in a row, that can never work.
I suspect we never reached this code path before, but the preview does
because the ComponentContainer probably instentiate its contents in
places that can cause the geometry cache to be empty while doing the
rendering (while it is most likely being filled when computing the dirty
regions
Both structure are bascially the same and only used internally, no need
to have the two.
The only difference was that one had the modifiers and the other one
not. But we can just set the modifier at the point we were converting
between the two.
Make the size argument to svg::render optional to mean that it is the
default size of the image.
Otherwise, passing None as the size to ImageInner::render_to_buffer
would not render the image which is possible in some backend (eg: the
button image icon with the qt backend)
And if the image is really rendered on an empty because of layouting or
so, we don't need to show a warning anyway.
Fix#3790
This fixes the widget having the right size and sifes some strange
issues I had been wondering about for a while now!
Pass own size to children instead, so that they will always have
matching sizes.
This fixes a couple of bug:
- Bug #3740 happens because `Repeater::model_set_row_data` did not use
the inner.offset to get the instance (So that's the `val == 106` part
of the test)
- But I went ahead and also tested what happenned if you changed the
model from the "outside" using the `model[i] = `, and that was not
implemented, hence the move of the code from
`Repeater::model_set_row_data` to `RepeaterTracker::row_changed`,
That does need Pin though, so Pin was added everywhere
- C++ is not affected by bug #3740, because because the C++ listview
don't do the "allocate only visible" optimization. But the
"val == 1106" part of the test would fail so this patch also moces
the update from `model_set_row_data` to `row_changed`.
But following that we don't set the state as Dirty in `row_changed`,
the write_to_model test started filling because the `row_added`
function was missing an update of the index on every further items
The change in the interpreter prevent a borrow_mut from causing trouble.
The Value really don't need to be in a RefCell anyway
Fix#3740
Following the winit 0.29 merge, a few adjustments are in order:
- Make slint::Window.set_size() before show keep the size
- on wasm, attempt to keep the size of the canvas from CSS
- on wasm, one must set the width and height explicitly on the canvas
otherwise there is wierd scaling
- on wasm, we can't set None as maximum or minimum size otherwise winit
panics
- It seems that the hack we had to keep the size in range is no longer
necessary
- The hack in the slide puzzle can be removed. (but unfortunately it
doesn't follow resizes
Unfortunatelly we always call set_inner_size to avoid infinite loop when
the css properties are not specificed, so this will override layouts
Also we don't default anymore to the preferred size
* Update internal/backends/winit/winitwindowadapter.rs
In `ItemRc::find_sibling` we currently do:
1. get the range
2. check that the next index is within the range
3. call `get_subtree`
The problem is that get_subtree itselg will call 'ensure_updated' which
will do the relayout of the ListView and may get a different range of
element.
So don't query the range before and just have get_subtree to return an
empty ItemWeak if we are out of the actual range.
Couldn't really find a way to make a test since this is called from
the accessibility code which is hard to test as is
For #3700