Commit graph

11401 commits

Author SHA1 Message Date
Olivier Goffart
66370b6bda
Add export { ... } from "....slint"; syntax. (#5533) 2024-07-03 12:50:40 +02:00
Danut Enachioiu
033e4de9b9
Update language-specific docs to document that public functions can be called from the backend code (#5522)
* Examples for calling public functions in language-specific docs.

* Update the function example so it actually uses its parameter.

(This broke some c++ tests because of the unused argument warning)
2024-07-03 12:13:08 +02:00
aurindam
07e10f37ab Update from slint-ui/website
Update index.html from commit 13b13f0f64e81eb116d9f31a1a642063d979287b (refs/heads/prod)
2024-07-03 10:05:16 +00:00
Olivier Goffart
f93729ffe2 Port LSP to slint_interpreter::Compiler
Add a feature to only generate a specified component.
2024-07-03 11:51:23 +02:00
Simon Hausmann
bc458ebb26 Add rotation properties to the Text docs
Amends 7896e645b2
2024-07-03 11:16:58 +02:00
Simon Hausmann
97de0d8ad8 Fix VS code extension not loading when building with latest wasm-pack
The latest wasm-pack version creates, by default, a package.json
that has a "type": "module" entry in it.

We invoke wasm-pack to build the lsp module and store it in the out/
folder. Next we run esbuild to place out/extension.js - the main entry
point - into the same directory. That directory now also has the
wasm-pack generated package.json, which has the "type": "module", which
doesn't match our CJS out/extension.js.

When VS code does require("/path/to/extension/out/extension.js"),
node.js complains that extension.js is not an ESM because
out/package.json claims that it should be.

The fix here is to not generate the package.json file we don't need
anyway.
2024-07-03 10:42:51 +02:00
Simon Hausmann
4a1bb190a9 Add rotating text to the rotate example 2024-07-03 09:08:23 +02:00
Simon Hausmann
7896e645b2 Permit rotation properties on Text elements without children
This works with Skia, Qt, and FemtoVG.

cc #1481
2024-07-03 09:08:23 +02:00
Olivier Goffart
c250865032 Javascript: Multiple components 2024-07-02 13:38:52 +02:00
Olivier Goffart
e9e987a736 Fix warnings: there is no "std" feature in that crate 2024-07-02 13:34:11 +02:00
Olivier Goffart
a460bdd94f Improve coverage of Rust nightly in CI
Usefull to know in advance what warnings our users might get early enough
2024-07-02 13:34:11 +02:00
Olivier Goffart
60569673b5 Remove some cargo:rustc-check-cfg output:
- The cfg_aliases crate does it out of the box already
 - Don't create a build.rs for this only purpose when it can be added in
   Cargo.toml lints group. (This wasn't possible when the warning was
   first introduced in nightly)
2024-07-02 13:33:48 +02:00
Olivier Goffart
161a734805 Qt: fix unexpected_cfgs warning
We didn't emit the directive for all features
2024-07-02 11:50:27 +02:00
Olivier Goffart
72ab6582c4 Update changelog 2024-07-02 11:48:51 +02:00
Olivier Goffart
1baf227e9e Update AccessKit 2024-07-02 11:45:46 +02:00
Simon Hausmann
7d270812a3
Fix panic in slint::Timer due to double mutable borrow (#5525)
When stopping a timer, the removal from the timer list requires a mutable borrow.
If during that borrow the timer's closure is dropped and a `Drop` impl starts another time, then the attempt of
acquiring a mutable borrow for the timers list to insert the new timer fails.
2024-07-02 11:20:30 +02:00
Simon Hausmann
0c7d2062a5 Python: Add support for exporting multiple components 2024-07-02 10:52:22 +02:00
Simon Hausmann
a3435d218f Remove macOS-11 from the list of supported platforms
It's not supported by Apple anymore since September 2023
2024-07-02 10:48:13 +02:00
Simon Hausmann
0aaf5b57ab Fix formatting 2024-07-02 09:23:09 +02:00
Simon Hausmann
089e6280ab Fix cpp package build in the CI
macOS-11 is gone from the GH CI.
2024-07-02 08:53:10 +02:00
Simon Hausmann
a24c04fd84 linuxkms: Fix build with just renderer-skia
That one also falls back to software and when used with linuxfb needs
the timer based animation driver.
2024-07-02 08:50:42 +02:00
Olivier Goffart
02c43c66bd Use the new interpreter Compiler API in tests 2024-07-01 15:00:46 +02:00
Olivier Goffart
dbf4ca6e59 Interpreter: add the Compiler struct 2024-07-01 15:00:46 +02:00
Olivier Goffart
5bd352c430 Intepreter: Create a CompilationResult types that can hold Several ComponentDefinition 2024-07-01 15:00:46 +02:00
Tobias Hunger
e0ac115edd janitor: vtable: Fix struct SelfInfo is never constructed
Fix a build time warning.
2024-07-01 12:38:34 +02:00
Simon Hausmann
6d14f5ca15 Fix unused type warnings in i-slint-backend-linukxms build with default features
When no features are enabled, the TimerBasedAnimationDriver would be unused.
2024-07-01 11:33:46 +02:00
Tobias Hunger
dbde3c2f9e janitor: Remove unused variable warning in winit 2024-06-28 18:59:01 +02:00
Tobias Hunger
5663aa0cfd live-preview: Navigate to property
Clicking on an existing property in the PropertyEditor will ask
the editor to navigate to the right place.
2024-06-28 18:55:32 +02:00
Tobias Hunger
c9c293e3bd live-preview: Show properties of previewed element
... if no other element is selected.
2024-06-28 18:53:02 +02:00
Simon Hausmann
fd8bc22b40 Fix rustdoc warning about link to non-existent function 2024-06-28 15:33:59 +02:00
Simon Hausmann
bf919d300d Work around sometimes missing resize event on macOS with winit
Fixes #5509
2024-06-28 15:26:36 +02:00
Olivier Goffart
75539f0557 Some documentation for the property changed callbacks
Still in comments as this is experimental
2024-06-28 14:46:12 +02:00
Olivier Goffart
263af149c0 changed callback: limit chained callback to 10 invocations
in order to avoid infinite loops
2024-06-28 14:46:12 +02:00
Simon Hausmann
7f05b8aa39 Changed ElementHandle click API to a single_click and double_click function taking the button
That way one can also simulate double right click, for example. This is a little less convenient, more generic, but a reasonable compromise (perhaps :-)
2024-06-28 13:56:51 +02:00
Simon Hausmann
e78e68a1ba System Testing: Add support for clicking on elements 2024-06-28 13:56:51 +02:00
Tobias Hunger
5aa76d0a98 janitor: Ignore direnv config files
It's handy to have those, but not in git :-)
2024-06-28 13:42:24 +02:00
Olivier Goffart
2dcd7107ad Interpreter: give the right type to the model property instead of Value
This way it also start initialized with a value of the proper type, and
this will "fix" #5500 by not panicking anymore.
Fixes #5500
2024-06-28 13:06:57 +02:00
Tobias Hunger
74a8779e9c live-preview: Add a property editor 2024-06-28 10:58:45 +02:00
Olivier Goffart
dc5a8ac0e5 fmt: Format changed callback 2024-06-28 10:45:45 +02:00
Olivier Goffart
c144dc71b0 Fix change callback on an alias 2024-06-28 10:45:45 +02:00
Olivier Goffart
59942df91f Add some tests and fixes for change handler
Make sure that when inlining, the callback in the sub component
is executed before the root

Fix a warning in the generated C++ code
2024-06-28 10:45:45 +02:00
Olivier Goffart
a63618fcfe Fix error messages with invalid change callback 2024-06-28 10:45:45 +02:00
Olivier Goffart
36ccc9d658 Changed callback syntax coloration 2024-06-28 10:45:45 +02:00
Simon Hausmann
a4cd0d8113 Upstream FemtoVG
Apply suggestion from https://github.com/slint-ui/slint/issues/5177 to femtovg 0.9.2.

Fixes #4868
Fixes #5177
2024-06-27 18:50:30 +02:00
Simon Hausmann
b45945a234
Add support for async unit testing and element handle click events (#5499)
This patch adds async click functions to ElementHandle and adds timer support to the testing backend's event loop.
2024-06-27 17:05:58 +02:00
Olivier Goffart
f4085cfd13 winit: Fix setting the size with set_size before showing the window
Fixes #5489

We shouldn't resize the window to the size of the WindowItem after
start. This happens when set_size is called before show. The the
resize event didn't yet propagate the size to the WindowItem properties.
2024-06-27 16:12:35 +02:00
Tobias Hunger
5c10e0972c janitor: Cleanup a bit
* Make some members pub so I can use them later
* Clean up some namespaces
2024-06-27 13:11:55 +02:00
Tobias Hunger
4decde2632 live-preview: Split out tool components from component-list
... so I can reuse them in a to-be-defined PropertyEditor component.
2024-06-27 13:11:42 +02:00
Olivier Goffart
863fb4ca8e
janitor: update const-field-offset dependency requirement
To make sure nobody still use an old version that results in warning in the generated code 

Fixes #5490
2024-06-27 10:39:53 +02:00
Simon Hausmann
155156aab9 System testing: Add support for grabbing window contents as PNG encoded image 2024-06-27 10:25:03 +02:00