Commit graph

10295 commits

Author SHA1 Message Date
Olivier Goffart
2564eede9f Compiler: avoid two error message when trying to call a non-existing function 2024-01-24 20:06:48 +01:00
Simon Hausmann
93142bf417 winit: Always make skia-opengl available
The Skia OpenGL renderer is portable and sometimes esp. on Windows produces better results, so make it always available as an open if `renderer-skia` is enabled. `renderer-skia-opengl` continues to select the GL renderer as default.
2024-01-24 18:20:04 +01:00
Florian Blasius
866300c34b
Improved Slider drag and click behaviour (#4406) 2024-01-24 13:12:36 +01:00
Olivier Goffart
fce2a80a54 TextInput: Only send the IME if we have the focus
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)
2024-01-24 13:10:31 +01:00
Simon Hausmann
accf15815b Revert "Reduce size of release binaries"
This reverts commit ff30e3db5b.

Unfortunately this breaks the release build with corrosion, which
expects to find .pdb files and copy them into the artifact directory.
2024-01-24 13:00:20 +01:00
Simon Hausmann
ff30e3db5b Reduce size of release binaries
Default to stripping debug info.
2024-01-24 11:59:22 +01:00
Olivier Goffart
5ee47c78e6 TouchArea: reuse the click_count field in the event instead of re-implementing our own 2024-01-24 10:20:06 +01:00
Olivier Goffart
808db75022 Make sure that double click on two different item is not registered as double click
This is going to be tested as part of tests/cases/elements/toucharea_doubleclick.slint
once we used the click_count for the double_click callback
2024-01-24 10:20:06 +01:00
Olivier Goffart
573d4a3b50 Remove the test function for sending double_click
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
2024-01-24 10:20:06 +01:00
Simon Hausmann
6ce394b90a Fix initial animation tick before the event loop runs
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
2024-01-24 09:33:59 +01:00
Olivier Goffart
01336be871 Fix svg loading on android after update of resvg
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
2024-01-23 23:04:59 +01:00
Simon Hausmann
5a49c21c25 Remove unnecessary Pin::new_unchecked in ffi for item member functions 2024-01-23 18:08:27 +01:00
Simon Hausmann
9f440c2699 Node.js: Document global singletons 2024-01-23 17:51:01 +01:00
Simon Hausmann
e619a50601
Clarify TouchArea docs with regards to clicking and touching (#4409)
Mention that clicked is limited to the left mouse button, or any finger of course.

Fixes #4213
2024-01-23 17:45:56 +01:00
Olivier Goffart
a19a2cfc8d Material style: make the ScrollView pan with the mouse
Other style are more desktop oriented, but this is important on android
to pan with the finger
2024-01-23 17:44:16 +01:00
Olivier Goffart
f5bba87db0
Docs: explain how to use tokio futures
Discussed in https://github.com/slint-ui/slint/discussions/4377
2024-01-23 17:43:36 +01:00
Olivier Goffart
c350d787c1 Test: Add a js variant of delete_from_clicked
I thought this would reproduce a bug but it doesn't
2024-01-23 14:02:26 +01:00
Olivier Goffart
43dbf5709b Interpreter: fix segfault when trying to access destroyed parent
We were having a reference to the parent item tree, assuming the parent
was living longer than the item tree. But this is not the case if
there existed a ItemRc to one item in the inner part.

So use a Weak for the parent instead.
2024-01-23 14:02:26 +01:00
Simon Hausmann
2c3ab52511 Remove test cases from the root
- Move element_ref_on_root_compo to elements, as this relates to the
injection of the Window element
- Move member_fun_from_parent to issues as this was an issue specific to
  the Rust code generator (no issue filed though)
2024-01-23 12:25:48 +01:00
Simon Hausmann
ec1b991c53 Fix calling builtin member functions on the root item when a window item is injected
The element references, just like the named references, need to be fixed up.
2024-01-23 11:04:13 +01:00
Simon Hausmann
0e53b1529c Fix compilation of Rust generated code when calling builtin item member function through child component 2024-01-23 09:56:38 +01:00
Olivier Goffart
9113b877bd winit: avoid to poll or call request_redraw too often
Otherwise there will be a huge queue of request redraw command that
accumulate within winit.
This makes operation such as resizing a bit more soomth

Tested on X11
2024-01-22 19:22:16 +01:00
Olivier Goffart
c7aae4b77e Update resvg and related dependencies 2024-01-22 16:16:35 +01:00
Olivier Goffart
5a43f3b8af Janitor: dependency updates 2024-01-22 12:36:32 +01:00
Olivier Goffart
43d1f62fb1
publish_npm_package.yaml: make nightly version number monotonic
Use date formatting that include 0 for single number month and day. For example: 20240121  instead of 2024121. So that the current nightly version is bigger than the ones from December 2023
2024-01-21 09:25:07 +01:00
Olivier Goffart
168654fa29 Android: Implement InputConnection
So that we can use text prediction and other input method features
2024-01-21 09:21:41 +01:00
Olivier Goffart
daa40f43cd Android: Use java code to show or hide the keyboard
instead of coding it all in JNI

This uses build.rs to compile the java code into bytecode that is then
embedded in the binary and loaded at runtime
2024-01-21 09:21:41 +01:00
Simon Hausmann
a46b70833a Revert "Update Skia Rust Bindings"
This reverts commit f809b3ff41.

Unfortunately this broke the cross build :(
2024-01-20 09:11:11 +01:00
Olivier Goffart
25e80afd6b
LSP: preserve dashes vs underscore in auto-completion
According to the wording in which it is defined

Fixes https://github.com/slint-ui/slint/issues/3935
2024-01-20 06:37:37 +01:00
Simon Hausmann
f809b3ff41 Update Skia Rust Bindings
See https://github.com/rust-skia/rust-skia/releases/tag/0.70.0 for a list of changes.

The main change for us is that the D3D API was ported to the modern windows rust crate.
2024-01-19 16:59:22 +01:00
Simon Hausmann
8cee95e04c Fix documentation of the keyboard modifiers
Match the implementation :-)

Fixes #4335
2024-01-19 16:59:06 +01:00
Simon Hausmann
8e0af0bf63 C++: Add convenience functions to clear and replace the VectorModel's vector
This was requested by a customer recently and it seems rather straight-forward to implement and offer. `clear()` mirrors `std::vector::clear()` and `set_vector` mirrors the `set_vec` we have in Rust.
2024-01-19 16:58:20 +01:00
Florian Blasius
2871fadd5c
Added SliderBase and use it in non qt styles. (#4384) 2024-01-19 13:14:17 +01:00
Simon Hausmann
d44717a11d doc: Add a section for targeting MCUs in the C++ documentation
Fixes #4180
2024-01-19 11:42:30 +01:00
Tobias Hunger
03bed1a4eb lsp: Implement UI side of drag and drop
... the rust side is just qa mock yet.
2024-01-19 09:14:02 +01:00
Tobias Hunger
d05d8fe7da lsp: Test the component_catalog
Fix the component catalog to make the tests pass.
2024-01-19 09:14:02 +01:00
Tobias Hunger
7754fccdd4 lsp: Add Sidebar showing available Components
Just show what all the components currently available.
2024-01-19 09:14:02 +01:00
Tobias Hunger
bcac170262 lsp: Refactor Preview UI 2024-01-19 09:14:02 +01:00
Tobias Hunger
ad72f5499c lsp: Add experimental feature flag and forward it to preview UI 2024-01-19 09:14:02 +01:00
Florian Blasius
610dc13577
Fixes background on printerdemo_old (#4370) 2024-01-18 16:16:41 +01:00
Simon Hausmann
5e23dbe765 Fix reuse compliance check
Current versions of the reuse tool don't allow inline copyright and licsense information in SVG and CSV files anymore. Move those into the dep5 file.
2024-01-18 15:11:43 +01:00
Simon Hausmann
baad689fdb Don't crash the opengl_texture example when making the window very small
Provide a reasonable minimum size for the image.

Fixes #4195
2024-01-18 15:07:42 +01:00
Simon Hausmann
7a295d1b75 Bump Corrosion
Fixes #2508
2024-01-17 18:08:59 +01:00
Olivier Goffart
f1f141896f
Fix linear gradiant rendering in non square rectangle
Fixes https://github.com/slint-ui/slint/issues/3730
2024-01-17 17:44:51 +01:00
Simon Hausmann
d9ddc865c2 Fix panic when shutting down process on Linux
Commit 41bfe66447 bumped accesskit
dependencies, which introduced a version that uses threads.

That means the action handler as well as the initial tree update source
closure are destroyed in a thread that's not the ui thread. That means
we destruct a SenderWrapper<Weak<WinitWindowAdapter>> in a thread that
is not the same as the one the wrapper was created in, which causes
Drop for SendWrapper to panic.

Replace the use of SendWrapper here with safely copyable window ids.
2024-01-17 17:07:38 +01:00
Florian Blasius
c8f58be7c9
Reject events on disabled ComboBox (#4359) 2024-01-17 15:41:32 +01:00
Olivier Goffart
89e252b268 Janitor: upgrade web-time
Increased its version to 1.0 without changes
2024-01-17 15:26:03 +01:00
Tobias Hunger
6224d0afb5 compiler: Fix repeater_offset calculation
Only set the repeater_offset after the needed input data is in place.
2024-01-17 15:21:14 +01:00
Simon Hausmann
dd0805c8fc Node.js: Add binaries for macOS and Windows
These are built with the default features of the interpreter crate, as
unfortunately napi-rs doesn't allow us to select features on the command
line yet. The next version (3.0) will add that, then we can keep the
binaries in sync.

So meanwhile, these are basically winit/femtovg/software enabled
binaries.

cc #1991
2024-01-17 11:48:54 +01:00
Tobias Hunger
382b5486ca
Component container subcomponent (#4355)
This changes the component containers away from using a "MAGIC" index in the
placeholder dynamic item tree node it creates. These are hard to
integrate across sub-components.

Use index numbers right after the index numbers used by repeaters and
"extend" the repeater offset by the number of component containers in
the sub-component. This way we can piggy-back on the forwarding of
repeaters.

This has one annoying side-effect: We do have indices in our item tree
that are out of range for a repeater. But I think that is acceptable
considering that we never materialize that array anyway.
2024-01-17 11:26:08 +01:00