Commit graph

2728 commits

Author SHA1 Message Date
Olivier Goffart
6e316a9929 docs: Fix missing paragraphs in the slint crate docs
Regression in e1a6cbf8b4
2025-05-05 12:56:32 +02:00
dependabot[bot]
558aaedd89
build(deps-dev): bump ava from 6.2.0 to 6.3.0 (#8352)
Bumps [ava](https://github.com/avajs/ava) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/avajs/ava/releases)
- [Commits](https://github.com/avajs/ava/compare/v6.2.0...v6.3.0)

---
updated-dependencies:
- dependency-name: ava
  dependency-version: 6.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 11:53:26 +03:00
dependabot[bot]
9ed60ed543
build(deps-dev): bump typedoc from 0.28.3 to 0.28.4 (#8348)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.3 to 0.28.4.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.28.3...v0.28.4)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-version: 0.28.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 11:53:03 +03:00
Simon Hausmann
0002df2520
slint crate: Expose parts of the winit backend's previously private API (#8315)
Similar to the wgpu access, the `unstable-winit-030` feature exposes a
`slint::winit_030` module, which in turn re-exports `winit` but also
provides access to the `WinitWindowAccessor` trait. The
`BackendSelector` is extended to provide a way to hook into window
attribute creation as well as providing a custom event loop builder,
similar to what `i_slint_backend_winit::BackendBuilder` provides.
2025-05-02 09:21:13 +02:00
Simon Hausmann
0151ac4902 slint crate: Replace early return with no_run tag on code fence 2025-04-30 18:20:16 +02:00
Simon Hausmann
2f2478d1ea WGPU: Clean up public API
- Create a `slint::wgpu_24` module
- Re-export `wgpu` in it
- Place the WGPU config types used by the `BackendSelector::require_wgpu_24` function in it, and remove the 24 infix.

As an upside, this also adds the feature guard to the docs at least for the `wgpu_24` module.
2025-04-30 15:54:06 +02:00
ogoffart
e0099ea500 Bump version number to 1.12.0 2025-04-30 13:27:50 +00:00
Olivier Goffart
c8138ff1db
swrenderer: rewrite TargetPixelBuffer::draw_texture interface
Instead of using datastructure that are tailored to our line by line
renderer and draw functions, use more generic and future proof data that
are easier to handle by hardware accelerator, and may be easier to
stabilize.

The screenshots from the screenshots test have to be re-done
because the rounding is different

Note: the C++ API DrawTextureArgs is not exposed yet
2025-04-29 23:26:02 +02:00
Simon Hausmann
302926edfa
Skia: Improve multi-window rendering resource consumption (#8304)
Share Vulkan instance as well as Metal device and command queue across windows.
2025-04-29 18:58:09 +02:00
Simon Hausmann
da5e7d5b22 WGPU: Add support for using WGPU textures in Slint
This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.

The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-29 17:46:57 +02:00
Simon Hausmann
dbe4a684c6
biome: Enable lint to check for missing await statements (#8305) 2025-04-29 14:57:52 +02:00
Simon Hausmann
a50b8f8793
FemtoVG: Add support for WGPU based rendering (#8268)
Enable via the `renderer-femtovg-wgpu` feature flag.

cc #171
2025-04-25 14:37:32 +02:00
Simon Hausmann
98dc4a8657 FemtoVG: Abstract the rest of the FemtoVGRenderer type to be independent from OpenGL
The main visible external change is that FemtoVGRenderer is now a generic type, but in the public Slint API the type alias that uses the OpenGL backend is re-exported under the old name. This looks a little different in rustdoc
but appears to be source compatible.
2025-04-25 10:08:38 +02:00
Olivier Goffart
7d3cf6a451 Janitor: Bump corrosion version 2025-04-25 08:47:45 +02:00
Simon Hausmann
6595aee73c
Replace use of Rc<winit:🪟:Window> with Arc (#8257)
In preparation for wgpu usage, where the wgpu API requires the window
handle to be send, i.e. Arc<dyn HasWindowHandle>.
2025-04-24 13:28:51 +02:00
dependabot[bot]
aadd9e9e78
build(deps-dev): bump typedoc from 0.28.2 to 0.28.3 (#8214)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.2 to 0.28.3.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.28.2...v0.28.3)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-version: 0.28.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-24 11:35:09 +03:00
Simon Hausmann
eb825f2e95 Support default-font-* properties in Live-Preview
... by changing the resolution for the `WindowItem` to traverse the
item tree from the current item, instead of going to the window.

This doesn't quite fix #4298 because `rem` resolution is still missing.
That requires the built-in default font size function to be fixed as
well, which is non-trivial.

cc #4298
2025-04-24 09:18:45 +02:00
Simon Hausmann
7c02bbd833
Python: Fix doc link 2025-04-23 21:40:48 +02:00
autofix-ci[bot]
8fcc320bdd [autofix.ci] apply automated fixes 2025-04-22 22:30:32 +02:00
Kavindra Palaraja
41366cf272 Python: Minor improvements to API descriptions 2025-04-22 22:30:32 +02:00
autofix-ci[bot]
c0bdfa7169 [autofix.ci] apply automated fixes 2025-04-22 22:30:32 +02:00
Kavindra Palaraja
cafa43ff22 Minor updates to the documentation for readability and polish 2025-04-22 22:30:32 +02:00
Simon Hausmann
f94e5a73b0 Node.js: Fix support for loadFile() with an URL on Windows
We recommend the use of `loadFile(new URL("...", import.metal.url))`,
but this never worked on Windows, because we're not using the API
the Node.js docs even recommend to correctly covert to a local path on Windows.

(Apply the same logic to initTranslations)

Fixes #8209
2025-04-22 18:01:48 +02:00
Simon Hausmann
5dc8410f0a Python: Fix mis-rendering 2025-04-22 16:24:21 +02:00
Simon Hausmann
9ce290b706 Python: Remove empty building from source section as well as trying out section
The latter is not very useful on our website, and we typically don't do this with the intros for other languages.
2025-04-22 16:17:27 +02:00
Simon Hausmann
ae50fcde8a Take the Python API out of alpha to beta 2025-04-22 14:02:45 +02:00
Olivier Goffart
cd8ab8ce53
Fix array index access at negative index
Conversion from negative float to unsigned is saturating to 0 in rust
and undefined behavior in C++, we should therefore handle the case
properly

Fixes #8222
2025-04-22 11:28:09 +02:00
Simon Hausmann
c4386ce22c Fix esp32-p4 build
jtag is not supported with esp-println
2025-04-16 09:47:01 +02:00
Olivier Goffart
9b1d4e740c Document better the argument of the select_bundled_translation 2025-04-16 06:03:31 +02:00
Simon Hausmann
5cd1c157f1 Fix C++ crate build
The newer version of esp-println requires choosing the output channel.
2025-04-15 11:32:27 +02:00
Juraj Michálek
fafde05338 initial migration to esp-hal-1.0.0 2025-04-15 11:32:27 +02:00
Olivier Goffart
78a3757b7f
Remormat all the toml file again to fix npm upload
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical

Add a .taplo.toml file

Also do not split feature array
2025-04-09 15:06:00 +02:00
Simon Hausmann
ac256d61d8 winit: replace special private function to spawn event loop with public API in the winit backend builder
This means the event loop spawning goes through the backend, which will permit for state from the Backend struct to be available when spinning the event loop even when spawning it merely.
2025-04-09 08:50:39 +02:00
Simon Hausmann
4e65998016 Clean up wasm-interpreter / winit interface
Use the window attributes hook instead of a private function in the winit backend.
2025-04-09 08:50:39 +02:00
dependabot[bot]
2feb048fa5
build(deps): bump typescript from 5.8.2 to 5.8.3 (#8069)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.8.2 to 5.8.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 11:00:19 +03:00
dependabot[bot]
b7467df94a
build(deps-dev): bump typedoc from 0.28.1 to 0.28.2 (#8073) 2025-04-08 08:24:04 +03:00
Simon Hausmann
826ad7a865 Upgrade to PyO3 0.24
The main change is that Rust paths are mapped to pathlib.Path, which changes our API (stricter).
2025-04-03 12:24:02 +02:00
Simon Hausmann
0c51f69b0a Upgrade to PyO3 0.23 2025-04-03 12:24:02 +02:00
Simon Hausmann
ad74c31ed4 Remove dependency on gil-refs feature
(which will be removed in future versions)
2025-04-03 12:24:02 +02:00
Simon Hausmann
9253af05b1 Upgrade to PyO3 0.22 2025-04-03 12:24:02 +02:00
Olivier Goffart
12a2493269
C++: add notify_ prefix to the Model functions and add docs
* C++: add `notify_` prefix to the Model functions and add docs

The `notify_*` function are used by the model to notify the view.
As opposed to the function without the prefix, which are used to get
notified when a source model change

Fixes #3888
CC #3945 (for the docs about thread safety)
2025-04-03 07:59:15 +02:00
Olivier Goffart
4145eafe14 C++: Fix segfault when calling Model::row_changed() after Model::reset()
Fixes #8021
2025-04-02 12:41:57 +02:00
Tobias Hunger
cd6f2e2cf2 ci: Format toml files
... using taplo with default settings

I tried this with 4 spaces indentation, but the patch is almost as
big as this one, so I went with default settings instead as that
is just easier:-)
2025-04-02 11:03:41 +02:00
Olivier Goffart
6f4f5aeefa Replace no_mangle with unsafe(no_mangle) in example and docs
We can't just do `s/#\[no_mangle]/#[unsafe(no_mangle)]/g`
because the version of cbingen we use doesn't understand the unsafe
attribute yet.

Part of #7998
2025-03-31 17:35:22 +02:00
Olivier Goffart
bf3c47f1fa C++: add code sample form model adapters
Fixes #4967
2025-03-31 16:13:45 +02:00
Simon Hausmann
ed878f01ac Python: Add third-party licenses page to the docs
Fixes #6634
2025-03-29 18:04:30 +01:00
Olivier Goffart
aca30901be C++: put the parent in a weak pointer
Right now we always `lock().value()` it which is the equivalent of
`upgrade().unwrap()` in rust, this helps because it keeps the parent
alive when we are calling function in it.

Ideally we should also check that it wasn't deleted, but that's another
issue.

Fixes #7880
2025-03-28 17:24:14 +01:00
Olivier Goffart
a80f14e7d8 Fix re-instentiating if elements when the condition is dirty
Fixes #3953
2025-03-27 15:37:07 +01:00
Olivier Goffart
54a3506f4d C++: move model code to its own file
Most of the slint.h file is used for model code, so before doing some
work on the model i wanted to refactor the code in its own file.
Since the model need access to the ComponentHandle, i also had to move
that in its own file
2025-03-25 10:37:20 +01:00
dependabot[bot]
c5527e3311
build(deps-dev): bump typedoc from 0.28.0 to 0.28.1 (#7928)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.0 to 0.28.1.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.28.0...v0.28.1)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 09:30:33 +02:00