For native PopupWindow (qt backend) instead of relying on the destructor
to close the popup (usually in the next event loop, if no one had a hold
on any ComponentRc from the popup) do call set_visible(false) so the
popup can be hidden immediatly
CC: https://github.com/slint-ui/slint/discussions/4532#discussioncomment-8366080
The ReverseModel had a bug that it didn't compute the index correctly
when removing several rows at the time
The FilterModel didn't adust its internal mapping if the row that was
removed was filtered out.
That caused a bug that can be reproduced in the todo demo:
Check "hide done items" and "Sort by name", then click "Remove Done
Items", then add a new entry and it panicked.
Notmaly the geometry is set in WindowInner::show()
But when calling set_component on an existing window, this is not
called.
This Fixes the slint-viewer reloading with the software renderer.
Otherwise, programatic changes to the text are not told to the input
methods.
This is important in the case of the todo example on android.
For example if one type
`foo<enter>bar`, the enter will cause foo to be added in the list, and
the text will be cleared. But then when typing bar, the input method
things "foo" is still in the text and "foo" will be re-added
As a side effect this fixes the infinite recursion from #4390
because there is a prevention that focus being sent to the element
inside a ComponentContainer (the bug is that this cause the size to be
computed which cause recursion)
They are not commonly used so no need to use semi-public api for that
and it's really easy to similate with ust two clicks anyway
The previous test function were added before there was public way to
send events
As soon as we have a backend, we might as well initialize the timer tick. This fixes animations not starting when run from user init callbacks.
Fixes#2809
It would incoditionally try to load the FONTDB that can't load any font
from the system using libloading
Instead, hardcode the path to the font to a known android font
Change the double-click implementation to send after two click events
were sent first.
This gets rid of the wait when a double-click handler is installed
before delivering the click.
Move the set_fullscreen function added to the WindowAdapter trait in 779aff0b39
to be a function in WindowProperties instead.
That way it'll be easier in the future to extend this with other window states without
having to modify or break the WindowAdapter trait API.
I get warnings about unused members using the nightly compiler, one for
each member in all structs that derive the `FieldOffsets` macro. That is
a lot.
This fixes that as well as the one occurrence of that same warning in
unrelated code.
I've tried to make sure the behavior match the one of native Window (and
Qt on Linux) apps, and android apps.
Windows set the focus on press, but android set the focus on release.
Also, the paste selection on middle click happens on release on Linux.
On android, when taping a text edit that currently has the focus,
we should show the virtual keyboard again if it was hidden by the user.
Having platform specific behavior like this in i-slint-core is not
optimal, but on the other hand, I'm not sure this deserve a new function
in the Platform trait
So that we don't erase selection or call edited unless there is
something typed.
Workaround a bug in which plasma/wayland sends many empty ime event:
```
WindowEvent { window_id: WindowId(WindowId(94309690701616)), event: Ime(Preedit("", None)) }
```
Fixes#4184
Profiling reveal they are not always inlined, despite they are only a
single instruction and can be used in a tight loop. So there is no
excuse to not inline them.