Commit graph

372 commits

Author SHA1 Message Date
FloVanGH
bad71b7a13
rust: added ToSharedString trait (#6845) 2024-11-20 13:17:26 +00:00
Olivier Goffart
5bd20def0e Experimental support for MenuBar
Introduces `MenuBar{ ... }` that can be put in a Window
2024-11-20 09:25:37 +01:00
Olivier Goffart
73b549a42c bundled translation: Better error reporting
forward the error up the stack instead of panicking while producing the llr
2024-11-19 21:34:42 +01:00
Simon Hausmann
179f657a50
Show the exact feature condition around feature-gated types/functions… (#6820) 2024-11-18 13:21:58 +01:00
Olivier Goffart
0dbc029cdc slint-build: Add config option to set the path for bundled translations
Part of #6793
2024-11-18 13:17:18 +01:00
Olivier Goffart
d68b84a3f1
Change API to set the language with bundle translation
* Change API to set the language with bundle translation

Part of #6793
2024-11-17 11:40:02 +01:00
Nigel Breslaw
08d90a5f13
Next gen docs for 1.9 (#6766)
Co-authored-by: Aurindam Jana <aurindam.jana@slint.dev>
Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-11-14 15:52:35 +01:00
Olivier Goffart
95f5685789
Bundle translations (#6661)
This currently doesn't have public API to enable it yet.

TODO:
 - Error handling in the compiler
 - Public API in the compiler configuration
 - Documentation
2024-10-29 15:07:15 +01:00
Simon Hausmann
a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
These are showing off use-cases for Slint, but they're not examples showing individual Slint features.

Also removed the old printerdemo while at it.
2024-10-25 12:09:32 +02:00
Ian Hattendorf
ac9b85049a Add PlatformBuilder API to allow selecting OpenGL API
Right now this just allows selecting between OpenGL and OpenGL ES.
2024-10-23 11:13:49 +02:00
Simon Hausmann
9eef4c9a96 Use approx_eq() also for comparing float point numbers in the Rust generated code
The parent commit does that for C++, and the interpreter's `PartialEq` impl for `Value` uses `approx_eq`, too.
2024-10-15 13:49:40 +02:00
Enyium
b3c9dfc6dc
Docs: Clarify that components' invoke_...() calls through synchronously. 2024-10-07 10:11:57 +02:00
Olivier Goffart
df88ac422d Update documentation of slint_buid::compile_with_output
CC: #6340
2024-10-04 15:26:20 +02:00
Willem Vanhulle
595221f928
Remove dependency on Cargo variables in a helper function for the Slint to Rust compiler (#6430)
Co-authored-by: Willem Vanhulle <willemvanhulle@gmail.com>
2024-10-04 15:18:37 +02:00
Olivier Goffart
ad1614bb10 Rust: attempt to gracefully handle situation where the property depends on a binding from a destroyed component
Prospective fix for #6262
2024-09-27 16:08:01 +02:00
ogoffart
eb273a63ee Bump version number to 1.9.0 2024-09-25 11:49:15 +00:00
Olivier Goffart
ea9f5d58a5 Update version number in docs and readme 2024-09-23 11:14:22 +02:00
Simon Hausmann
ddfbd1821a For our Rust, C++, and Node.js templates, recommend the use of a zip archive download instead of git
This removes any git history of ours from the download, and removes the need to have git installed.
2024-09-18 10:48:38 +02:00
Olivier Goffart
02467bd4cc
Change mod() to always return positive number (#6179)
* Change `mod()` to always return positive number

Closes #6178

ChangeLog: The mod function was changed to always return a positive value (#6178)
2024-09-17 11:37:32 +02:00
Wannes Van Leemput
58fcd80f69
Add is_finished to JoinHandle (#6034) 2024-09-16 15:17:47 +02:00
tiaoxizhan
552eb56e5b chore: fix symbol error
Signed-off-by: tiaoxizhan <tiaoxizhan@outlook.com>
2024-09-12 20:26:01 +02:00
Simon Hausmann
6868052dd1 Remove additional reference to cargo-install 2024-09-11 10:05:40 +02:00
Olivier Goffart
4de03fba5b Use f32 for float-to-string conversion
Because f64 has too much precision, so limit to f32 so that we don't
have extra precision we don't need and would be wrong as all our float
as in f32

(Also avoid double allocation in rust generated code)
2024-08-23 16:09:53 +02:00
Olivier Goffart
43c7f57b0f spawn_local: initialize the platform if not initialized before the call
Take the opportunity to refactor a bit the way the global platform or
context is accessed

Fixes: #5871
2024-08-21 13:26:04 +02:00
Olivier Goffart
cb72e48aa4 Macro: Fix lexing of 4..log
Use same rules for .slint and macro.

The test is `cargo test -p test-driver-rust` without the `build-time`
feature (but that feature is enabled in the CI and that's why CI didn't
catch this)
2024-08-19 14:09:42 +02:00
Olivier Goffart
a9f526491a Timer Element
Closes #5724
2024-08-16 16:36:38 +02:00
ogoffart
4dd7d96a28 Bump version number to 1.8.0 2024-08-15 12:44:46 +00:00
Simon Hausmann
18d6d2da29 Add Rust API for build.rs to specify the scale factor ahead of time 2024-08-14 11:00:50 +02:00
ogoffart
bbf7edc5a3 Bump version number to 1.7.2 2024-08-09 09:52:17 +00:00
Simon Hausmann
fbe0b23684
Improve documented workaround for Tokio integration (#5736)
Document the two constraints of using Tokio futures in Slint, and how to work around them.

Fixes #5733

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-09 08:28:43 +02:00
Simon Hausmann
336f75181d Mark SampleComponent in rust docs as !Send and !Sync
The actual generated components aren't Send/Sync either.

Fixes #5742
2024-08-02 09:31:20 +02:00
Olivier Goffart
195a54359c fix docs compilation when the renderer-software feature is disabled
Fixes #5743
2024-08-02 09:25:16 +02:00
Simon Hausmann
8a7db55bb6
Route debug() calls in Slint consistently through Platform's debug_log() (#5718) 2024-07-29 16:31:09 +02:00
ogoffart
aa25e3cd44 Bump version number to 1.7.1 2024-07-23 12:05:34 +00:00
Simon Hausmann
e36eb6aba6 Document behaviour of globals when exporting multiple components
Fixes #5467
2024-07-18 13:43:13 +02:00
Simon Hausmann
26296c86a2 Bump version in docs 2024-07-18 10:45:48 +02:00
Simon Hausmann
e35d05f6b9 API Review: Remove SharedImageBuffer from public API and rename Window::grab_window() to take_snapshot()
Use SharedPixelBuffer as return value for take_snapshot() and provide counter-parts to from_rgb* in Image as to_rgb*
2024-07-05 20:46:55 +02:00
Olivier Goffart
5dfa8d56dc API review of the slint interpreter Compiler api
Closes #5466
2024-07-05 17:20:08 +02:00
Simon Hausmann
544e4151ac Fix broken link to quick start in Rust API docs 2024-07-05 09:29:56 +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
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
42a2c6a569
Only generate code for the exported Window
Have a warning when a component is exported from the main file and
doesn't inherit Window.
Unless it's the last component, for compatibility with Slint 1.6

Also don't warn in the interpreter
2024-06-25 15:13:06 +02:00
Olivier Goffart
2fd8744cfc compiler: Move embedded_file_resources from the root Component to the Document 2024-06-20 12:03:38 +02:00
Simon Hausmann
db3d726886 Make it possible to retrieve a SharedImageBuffer for a slint::Image in Rust
This change exposes functionality of already existing internal API
that all renderers use to obtain pixels for upload to the screen - so
it's rather well tested.

This also exposes the `SharedImageBuffer` API, an enum that represents
different SharedPixelBuffer encodings.
2024-06-11 07:46:57 -07:00
Olivier Goffart
3da0ee5bb9 DatePicker: Logic in C++
Had to simplify a bit the rust logic to make it work
2024-06-06 09:03:50 +02:00
Florian Blasius
973ecac989 DatePicker: finished features 2024-06-06 09:03:50 +02:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02:00
Simon Hausmann
a52fe6bbfc Make element debug information configurable
The `SLINT_EMIT_DEBUG_INFO` environment variable needs to be set for Rust and C++ builds. For the interpreter it's always enabled, since ... we have it.
2024-06-05 01:29:58 -07:00
ogoffart
3a6e34ba45 Bump version number to 1.7.0 2024-06-04 20:34:29 +00:00
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +02:00