Commit graph

436 commits

Author SHA1 Message Date
Olivier Goffart
6b4c822a4a MenuBar: C++/Rust native menubar implementation
introduce a SetupMenuBar builtin function to ease C++/Rust lowering
2025-01-08 21:16:17 +01:00
Olivier Goffart
a942ed0852 Remove thiserror dependency
Uses derive_more instead
2025-01-06 17:25:08 +01:00
Simon Hausmann
4bb6320ea9
Add space in the docs between struct name and opening braces
It's been a little eye-sore :)
2025-01-01 09:30:05 +01:00
ogoffart
f309a551b5 Bump version number to 1.9.2 2024-12-30 10:18:16 +00:00
Olivier Goffart
8385de7825
docs.rs: remove the highlight of slint snippets
There is only very few Slint snippet and it causes problems generating
the docs on docs.rs
2024-12-21 09:08:49 +01:00
aurindam
dc3f29b6da Bump version number to 1.9.1 2024-12-19 12:57:19 +00:00
Olivier Goffart
995735ca12 Update version in docs 2024-12-18 13:26:30 +01:00
Simon Hausmann
13a05edcf8
doc: fix grammar 2024-12-16 16:27:39 +01:00
Simon Hausmann
0d36f88152 Revamp BackendSelector API
Based on API review, PlatformBuilder becomes BackendSelector with
a slightly smaller API surface but more options, such as selecting
Metal or Vulkan rendering.
2024-12-16 13:06:05 +01:00
Olivier Goffart
c0f346fdf7 Rust docs: have a macro to make link to the Slint doc 2024-12-12 16:44:31 +01:00
Simon Hausmann
e45e6996d5 Remove obsolete docs symlink
We shouldn't include markdown files directly anymore there but link to
the slint docs.
2024-12-09 15:00:17 +01:00
Olivier Goffart
b30f91ff41 Rename slint_build::compile_with_output to compile_with_output_path 2024-12-09 04:07:52 +01:00
Nigel Breslaw
92534a8a27
1.9 Organise docs folder. (#7005)
Move astro files to docs/astro
2024-12-05 15:40:04 +02:00
Olivier Goffart
9683b67576 swrenderer: intersect the dirty region with the screen rectangle
When rounded out, the dirty region might end up bigger than the size
of the screen, which would then result in panic while trying to draw a
pixel out of the screen.

Fixes #6932
2024-11-28 17:35:26 +01:00
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