Olivier Goffart
90f5621985
Fix string formatting of big integer
...
Don't lower the precision to f32 for big enough numbers
2025-01-20 15:55:44 +01:00
Simon Hausmann
62d9f8b13f
Minor dependency cleanup
...
- static_assertions is only needed with ffi.
- i-slint-core-macro is not needed in the build crate.
2025-01-16 14:45:05 +01:00
Simon Hausmann
8e6d2c80e5
Use unicode-segmentation from the Cargo workspace
2025-01-14 19:31:34 +01:00
Tasuku Suzuki
68b9dfc247
String: Add .is-empty and .character-count properties
...
Introduce two new properties for string in .slint:
- .is-empty: Checks if a string is empty.
- .character-count: Retrieves the number of grapheme clusters
https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries
These additions enhance functionality and improve convenience when working with string properties.
2025-01-14 19:29:05 +01:00
Olivier Goffart
8a5df27469
Update to Image 0.25 ( #7365 )
...
Added image-default-formats with all the format supported by image by
default, and enable that feature by default.
Also put that feature in compat-1-2 for compatibility with user that
have used image 0.24 with enabled features.
Make a new compat-1-10 feature that does not enable default format by
default
ChangeLog: upgraded image crate to 0.25, added a new cargo feature
to enable all image formats. (that feature is enabled by default with
compat-1-2, added compat-1-10 to disable it
Fixes https://github.com/slint-ui/slint/issues/7251
2025-01-14 16:31:05 +01:00
ogoffart
c83af3ca5c
Bump version number to 1.10.0
2025-01-13 13:38:41 +00:00
Tasuku Suzuki
346d1c2df3
Fix typos
...
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Olivier Goffart
3e94bd2167
Janitor: Remove trailing whitespaces from all files
...
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
Olivier Goffart
cfbcf0b1d7
Introduce Window::try_dispatch_event ( #7313 )
...
That is the same as Window::dispatch_event, but it reports an error
instead of panicking
2025-01-09 19:39:38 +01:00
Jocelyn Turcotte
8ea5662242
Fix the hello world slint macro example
...
The slint VS Code plugin is otherwise reporting the warning:
Exported component 'HelloWorld' doesn't inherit Window. This is deprecated
2025-01-09 11:09:53 +01:00
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