Commit graph

355 commits

Author SHA1 Message Date
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
Olivier Goffart
ce1b4f32e8 Janitor: fix formatting 2024-06-03 16:05:51 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Wilston Oreo
23f7a7864d
Some Android and MCU doc (#5286)
MCU: Add missing info for software renderer
Android: Add some more details for dev env setup
2024-05-22 18:25:44 +02:00
Michael Winkelmann
95e371b3fc mcu.md: Add "renderer-software" as feature 2024-05-16 11:40:20 +02:00
Simon Hausmann
3c5bd71a3b doc: more version bumps 2024-05-13 09:36:17 +02:00
Simon Hausmann
dea86e1e34 doc: bump version from 1.5.0 to 1.6.0 2024-05-13 09:34:37 +02:00
Olivier Goffart
ebc4a14602 Update the android-activity crate by adding a new feature
The android-activity 0.5 no longer works with Rust 1.78 because it
asserts with
> slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`

Note that the documentation is build with the 05 feature because it also
build the winit backend crate in the same command that still depends on
android-activity 0.5 via winit
2024-05-07 12:48:49 +02:00
Olivier Goffart
cadcd4caf4 Change callback: rust code generation 2024-05-02 22:25:53 +02:00
Olivier Goffart
f45bab6a3f swrenderer: Support multiple rectangles for the dirty regions
This allow to be much faster in the case two small area of the screen
changes.
2024-04-26 14:45:23 +02:00
Olivier Goffart
d4741efac0 testing: rename the init function 2024-04-18 18:45:31 +02:00
Olivier Goffart
8030732f46 Refactor the testing backend
Move code around and gate the internal functions used in our own tests
so we can make the testing backend public
2024-04-18 18:45:31 +02:00
Olivier Goffart
13127dc71c Accessibility: Add support for accessibility-action-* callback (#5073)
Merge branch 'feature/accessibility'

 Conflicts:
	internal/compiler/widgets/cosmic-base/button.slint
	internal/compiler/widgets/cupertino-base/button.slint
	internal/compiler/widgets/fluent-base/button.slint
	internal/compiler/widgets/material-base/button.slint

Also updated license header in actions.slint
2024-04-16 15:02:25 +02:00
Simon Hausmann
305e02e334 Revert "Add a "image-default-formats" feature" and "Janitor: Update the image crate"
This reverts commit a159562ea7 and just
the version part of commit 1d2201a7ce to
downgrade image to 0.24 again.

This is not a straight revert, the workspace unification remains, just
the version is down to 0.24.

The update to the new image crate version causes two issues

- With the Xtensa Rust toolchain, a release build of the image crate
  takes excessively long (cargo +esp build --release in image-rs)
- The image crate version updates to zune-jpeg for JPEG decoding,
  which uses "cdylib" in crate-type, which in turn breaks the
  cross-compilation with Corrosion against a Linux sysroot, because
  the (unnecessary) zune-jpeg cdylib creation doesn't see corrosion's
  link args that provide the sysroot.
  (upstream PR at https://github.com/etemesi254/zune-image/pull/187 )

By reverting, this also closes #5068.
2024-04-16 14:55:50 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Olivier Goffart
a159562ea7 Add a "image-default-formats" feature
To enable the feature from the image crate.
And enable it by default.
Because users of older version of slint may have enabled feature from
the image 0.24 crate. But since we upgrade to image 0.25, this these
format would not be supported by Slint. So enable them by default to
keep compatibility
2024-04-15 12:11:54 +02:00
Chris Chinchilla
7afa34a7e1
Rename tutorial to quickstart (#4941) 2024-04-04 13:26:24 +02:00