Commit graph

446 commits

Author SHA1 Message Date
Tobias Hunger
06b04e71b5 compiler: Return the TypeLoader from compile_syntax_node 2024-02-29 19:35:52 +01:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Simon Hausmann
d4a6c5774e Add support for writing tests that run with all styles
Tests under tests/cases/for_each_style are run with all styles at least
in the Rust driver.

Amends 6bb9905191 to include a test that
using edited works.
2024-02-23 16:12:45 +01:00
ogoffart
a0eed4e58e Bump version number to 1.5.0 2024-02-20 17:33:11 +00:00
Olivier Goffart
ddebd64064
Android: make slint::android public
Add a `backend-android-activity-05` feature that enables the
`slint::android` module
2024-02-20 15:00:11 +01:00
Tobias Hunger
a8f912900b janitor: Fix warnings in nightly about redandant use 2024-02-19 17:05:21 +01:00
Olivier Goffart
af8075d1b2 Only enable the Qt backend by default on Linux
The trick is that the backend selector build by default with the
i-slint-backend-qt, but the "enable" feature is only enabled if the
qt-backend feature is enabled explicitly, or on linux from the slint
or slint-interpreter crate
2024-02-07 15:20:03 +01:00
Simon Hausmann
fd48321e99
Permit the use of Image, Brush, and related data types in slint_interpreter from Rust without depending on i_slint_core (#4552)
Re-export them just like in the slint crate.
2024-02-06 21:34:30 +01:00
Olivier Goffart
09a5c724bf ListView: Fix redraw when model changes
Amend 48180919da
That commit added the dependency, but did not reset the dirty flag, so
it only worked once.

Fixes: #4538
2024-02-05 15:02:44 +01:00
Yuya Nishihara
004749157f Fix rust codegen to skip over backslash-escaped character
If the generated code contains "\"" and format!("{}", ..), the latter would be
corrupted because the code formatter rewrites "{}" as if it were a code block.
2024-02-02 08:35:03 +01:00
ogoffart
fec2b961db Bump version number to 1.4.1 2024-02-01 09:12:42 +00:00
Simon Hausmann
988e4fcd09 Bump more version numbers in Rust docs 2024-01-31 09:12:27 +01:00
Simon Hausmann
a90a75266d Bump version number in mcu docs 2024-01-31 09:11:01 +01:00
Olivier Goffart
fa24283cd4 Add a few funciton to make SlintContext usefull
Make it possible to spawn future and run event loop with a SlintContext
handle
2024-01-29 15:34:48 +01:00
Olivier Goffart
1e19e0a754 Rust codegen: fix compile if slint names matches internal names
Fixes #4419
2024-01-24 22:47:58 +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
9111946a82
Introduce slint::run_event_loop_until_quit
Closes #1499
2024-01-11 13:52:02 +01:00
Carter Hunt Fogelman
ff27bc79ae Wrap all non-test uses of in a BufWriter/BufReader for efficiency 2023-12-27 09:15:53 +01:00
Simon Hausmann
18c5b1ebea doc: Fix link from Rust API docs to Slint language docs for singletons
Fixes #4158
2023-12-14 13:41:25 +01:00
Simon Hausmann
c1841fdfbe Add support for compiling the linuxkms backend without libseat support 2023-12-11 17:36:17 +01:00
ogoffart
b081c489d6 Bump version number to 1.4.0 2023-12-11 11:21:37 +00:00
MicroBlock
003e177ef7 docs: fix winit link 2023-12-09 09:10:49 +01:00
ogoffart
b9255ab8e2 Bump version number to 1.3.2 2023-12-01 08:05:15 +00:00
ogoffart
0a5bf6c37b Bump version number to 1.3.1 2023-11-23 07:47:07 +00:00
Olivier Goffart
0b70cbc9a9 Don't use workspace deps for dev-dependencies
They can't have version otherwise we can't upload to crates.io
2023-11-10 11:03:10 +01:00
Olivier Goffart
fd35e24566 Disable FemtoVG on Android
Causes compilation problem with default features otherwise

And doesn't work anyway
2023-11-02 17:06:25 +01:00
Tobias Hunger
2def4d2495 janitor: Suppress warning about unused native_widgets module
The module is empty when Qt is not around, which triggers a warning in
the nightly compiler.
2023-11-02 10:17:59 +01:00
Olivier Goffart
c51fb14a0e Improve the slint! macro with rust-analyzer with -
We currently use the debug representation of Span to know if they are
next touching eachother as there are no stable way currently.
But that doesn't work with rust analyzer as it doesn't have a
representation we can test.
Also Span::source_text is not implemented with rust analyzer.

So just default to identifier with `-` touching instead of not touching
as this happens more often.

One can still use `(foo)-(bar)` when one really need minus

CC #685
2023-10-26 13:13:03 +02:00
J-P Nurmi
c5248c005e Allow specifying paths for @library imports 2023-10-20 16:47:00 +02:00
Simon Hausmann
e0d1d4366d doc: In the type mapping, refer to the angle as "angle", not as "value" 2023-10-17 13:26:04 +02:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Olivier Goffart
852b4d906d Rename ComponentVTable to ItemTreeVTable
and their related name.
Also move the component module in the item_Tree module
register_component -> register_item_tree
ComponentItemTree -> ItemTreeNodeArray

For #3323

Rationale from that issue:

Right now, we use the term `component` in the Slint language and in the compiler to be a a tree of elements that can be used as an element in a .slint file.

The term is also currently used in the runtime as a tree of runtime Items that are allocated together. (declared in ComponentVTable)

But there are no 1 to 1 mapping between a `component` in the slint language, and a runtime Component.
(for example, the items behind a `if` or `for` or `PopupMenu` are in a different runtime component. And `component` declared in Slint are often inlined)

So we should rename the internal runtime `Component` to  `ItemTree`

The currently public `slint::ComponentHandle` wraps the "root" of the ItemTree, but that's ok because it is generated from a .slint `component`,  so it doesn't change name
2023-10-09 11:01:56 +02:00
Olivier Goffart
86968d6f80 Dependencies update 2023-10-02 20:27:25 +02:00
Olivier Goffart
d688f37ee8 Change alias to the native style depending on the platform
Fixes #3431
2023-09-29 17:05:10 +02:00
Olivier Goffart
ea19c1e962 Remove the preview from the rust docs
rustdoc removes the `no-preview` tag, and we anyway do not have a
slint file to preview in the docs anymore
2023-09-29 10:40:45 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
da7023a073 Update version information to 1.3.0 2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
Simon Hausmann
25d954b869 Fix link to modules syntax docs
Fixes #3526
2023-09-21 19:31:44 +02:00
Simon Hausmann
cc7ce65c0d Don't show a preview for the sample component in the Rust docs
It's not a visual example.
2023-09-19 10:56:34 +02:00
Olivier Goffart
f2c3b98a7d Hide the ComponentFactory from the docs
It was not meant to be public.

Added a deprecated note even if deprecared on `pub use` don't show warnings
2023-09-19 09:41:49 +02:00
Olivier Goffart
196f14e89f rust: return LogicalRect for inner item_geometry functions
(More in line to what C++ does)
2023-09-13 16:08:37 +02:00
Olivier Goffart
e0fd9a6105 WIP: Add item_geometry to the ComponentVTable
(unused yet)
2023-09-13 16:08:37 +02:00
Simon Hausmann
c8b05c2b05 Add documentation about the different renderers, their pros/const, and availability in backends and API 2023-09-12 11:28:17 +02:00
Olivier Goffart
a565ed53fd Upgrade MSRV to 1.70
Many of our dependencies already made the jump and require a cargo update hack, so make it official

Removed the MSRV from the README since it applies to master branch and people read the readme also for
the released version. There is enough documentation of the MSRV in other locations.
2023-09-06 12:09:03 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Simon Hausmann
5e9aa8830e Bump Slint version in various doc samples to 1.2.0
Same as commit 2a2e38315e
2023-09-04 10:17:02 +02:00
Simon Hausmann
2a486edd82 Mark the linuxkms backend as experimental 2023-08-31 11:30:51 +02:00
Olivier Goffart
f7a44d7dfc Rust docs: make the main page shorter by moving sections in their modules 2023-08-30 18:33:51 +02:00
Simon Hausmann
24df168f04
Make the FemtoVG renderer public in the Rust API (#3371) 2023-08-29 18:34:59 +02:00