Commit graph

897 commits

Author SHA1 Message Date
Simon Hausmann
a61ca93cd1 doc: Attempt to clarify how the factor of color's mix() function is applied 2024-04-15 09:05:54 +02:00
Simon Hausmann
cacc13343f
Clarify the Windows C++ package compiler dependency (#5053)
Add a -MSVC suffix to our binary package (and prepare for future MinGW build)

cc #5052
2024-04-15 08:28:19 +02:00
Russell Greene
5c6e3bab04 rerun-if-env-changed=SLINT_GENERATED_INCLUDE_DIR
cargo currently doesn't know that we read this env var, which can lead to caching issues
2024-04-12 11:47:23 +02:00
Olivier Goffart
36669e8df7 esp-idf: redirect debug_log! to esp-println 2024-04-05 15:24:52 +02:00
Olivier Goffart
e2bfb9a513 esp-idf: fix gating of experimental feature
Commit 31219223e5 removed the optional,
but didn't remove the default argument
2024-04-04 15:43:34 +02:00
Olivier Goffart
80b59653a2 Janitor: Fix warnings with no_std and nightly rust 2024-04-04 14:03:36 +02:00
Chris Chinchilla
7afa34a7e1
Rename tutorial to quickstart (#4941) 2024-04-04 13:26:24 +02:00
Olivier Goffart
31219223e5 C++: Gate the line by line rendering behind experimental flag 2024-04-04 10:23:00 +02:00
Olivier Goffart
48d1b96441 esp-idf: cleanup the line_by_line rendering 2024-04-04 10:23:00 +02:00
Simon Hausmann
042bde7883 esp-idf: Add support for line-by-line rendering
Rendering by line into a line buffer that's in IRAM can be faster than accessing framebuffers in slower PSRAM, so offer this by allowing users
to omit even the initial framebuffer.
2024-04-04 10:23:00 +02:00
Francesco Cusolito
e8ce0cb5e5
C++: FilterModel with deferred filtering (#4984)
Avoids to invoke filtering function until FilterModel is completely constructed, deferring it to first model usage.
2024-04-02 09:03:07 +02:00
Olivier Goffart
523e1a161c WIP: More on support for accessibility actions
Continue with the core library support and the compiler support.

This hasn't been tested yet and is missing implementation in the
backends
2024-03-28 11:28:56 +01:00
Olivier Goffart
fe38a1e97d C++: Fix and test the reset function on model adapter
They were causing infinite recursion because they were calling
themselves.

Also add the missing MapModel::reset

Yet another motivation for https://github.com/slint-ui/slint/issues/3888
as the code was mixing the `reset` function on the adapter meaning
"please re-apply the adapter filter/map/sort function" with the `reset`
function on Model which means "the subclass has changed and we should
notify listeners".

Fixes #4968
2024-03-28 11:11:57 +01:00
Olivier Goffart
fd4dcfc128
Update MSRV to 1.73
A MSRV update is required to update the image crate to 0.25, otherwise
we get link error that are ficed in newer version.
Also other dependency update such as env_logger needs a newer MSRV.

Update to 1.73 because it has functions like `with_borrow` on thread
storage which we already actually use in some platform.

This is also the last release before the the drop of macOs < 10.12
in Rust 1.74
2024-03-27 09:04:31 +01:00
ogoffart
6bf40989d9 Bump version number to 1.6.0 2024-03-27 07:49:22 +00:00
Simon Hausmann
68083243b2
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine
which mode is active.
2024-03-26 15:44:22 +01:00
Simon Hausmann
b988d6d198 esp-idf: poll for touch events if there's no touch interrupt assigned 2024-03-20 13:01:45 +01:00
ogoffart
20c570ab1d Bump version number to 1.5.1 2024-03-18 08:55:01 +00:00
Simon Hausmann
b1f408f683 Fix build of generated C++ code when using transitions on int properties with esp-idf
The energy monitor declares a transition on an animated int property,
for which Property<int>::set_animated_binding_for_transition is called,
which in turn calls slint_property_set_animated_binding_helper. The
latter is overloaded for various property types, such as float, Color,
or Brush, and then calls specialized functions from ffi, such as

slint_property_set_animated_binding_(int|float|etc.).

slint_property_set_animated_binding_int uses i32 in Rust, which cbindgen
maps to int32_t, so the
slint_property_set_animated_binding_helper overload also uses int32_t.

Unfortunately, with esp-idf, int32_t is a distinct type from int, and
the overload resolution fails.

As remedy, this change uses c_int instead of i32 in the Rust ffi, which
maps to int.

This seems easier than changing Property<int> to Property<int32_t> :-)
2024-03-12 20:25:00 +01:00
Simon Hausmann
76ac137438 Fix build against esp32-p4
- Bump esp-backtrace for esp32-p4 support, which removes the uart feature and delegates to esp-println
- Added esp-println dependency
- Add mapping for ESP32P4 and other risc-v esp-idf targets to the corresponding rust target triplet.
  Unfortunately there's no generic pattern like for xtensa, as can be seen on
  https://github.com/esp-rs/esp-idf-sys?tab=readme-ov-file#examples
2024-03-11 17:49:15 +01:00
Simon Hausmann
e541053c6c Fix build against current esp-idf git
It looks like the esp_lcd_rgb_panel.h header file is not unconditionally
available anymore. Guard it with the same #ifdef that's surrounding the
calls to esp_lcd_rgb_panel_* and include the header that provides it.
2024-03-11 17:49:15 +01:00
Simon Hausmann
efb626a54a
C++: Fix incorrectly documented minimum supported Rust version 2024-03-08 15:20:53 +01:00
Simon Hausmann
77f0cd9eac Fix license header check for Pipfiles 2024-03-07 10:08:12 +01:00
Wilston Oreo
bef532b5fc
Optional C++ namespaces (#4759)
Co-authored-by: Michael Winkelmann <michael@winkelmann.site>
2024-03-06 19:43:11 +01:00
Simon Hausmann
fa2cf8c28a C++ Interpreter: Add support for setting the translation domain
This maps straight to the Rust API.
2024-02-22 16:58:38 +01:00
Olivier Goffart
9f0c3c94a9 C++: minimize/maximize/fullscreen API on Window 2024-02-22 13:17:50 +01:00
Ralph Minderhoud
9cb1a4a4e0
Add API for minimize/maximize on Window component (#4581)
Closes #4400
2024-02-22 10:40:36 +01:00
Olivier Goffart
7b2ff89f1c Fix nightly warnings
eg:
```
warning: the item `Box` is imported redundantly
```
2024-02-21 10:52:04 +01:00
ogoffart
a0eed4e58e Bump version number to 1.5.0 2024-02-20 17:33:11 +00:00
Olivier Goffart
97067c3d65 Add 9slice information at runtime 2024-02-13 14:46:27 +01:00
Olivier Goffart
9b094251b8 C++: only enable the qt backend by default on Linux 2024-02-07 15:20:03 +01:00
Olivier Goffart
af8075d1b2 Only enable the Qt backend by default on Linux
The trick is that the backend selector build by default with the
i-slint-backend-qt, but the "enable" feature is only enabled if the
qt-backend feature is enabled explicitly, or on linux from the slint
or slint-interpreter crate
2024-02-07 15:20:03 +01:00
J-P Nurmi
cc5d2b24e5 Add BasicBorderRectangle to avoid unnecessary xxx-border-radius bindings 2024-02-06 18:01:35 +01:00
Olivier Goffart
5e12f0876f C++: fix the FilterModel's row_removed
Same fix as in the rust equivalent from previous commit
2024-02-05 12:04:30 +01:00
Olivier Goffart
9200480b53 Fix a few links to the docs that changed with the new structure 2024-02-03 09:38:49 +01:00
ogoffart
fec2b961db Bump version number to 1.4.1 2024-02-01 09:12:42 +00:00
Simon Hausmann
45f182e666
C++: Permit passing a value to VectorModel::set_vector by value (#4491)
The previous signature would not allow that, but we should allow it for consistency with the constructor.
2024-01-31 16:09:06 +01:00
Olivier Goffart
1e19e0a754 Rust codegen: fix compile if slint names matches internal names
Fixes #4419
2024-01-24 22:47:58 +01:00
Olivier Goffart
573d4a3b50 Remove the test function for sending double_click
They are not commonly used so no need to use semi-public api for that
and it's really easy to similate with ust two clicks anyway

The previous test function were added before there was public way to
send events
2024-01-24 10:20:06 +01:00
Simon Hausmann
9f440c2699 Node.js: Document global singletons 2024-01-23 17:51:01 +01:00
Olivier Goffart
5a43f3b8af Janitor: dependency updates 2024-01-22 12:36:32 +01:00
Simon Hausmann
8e0af0bf63 C++: Add convenience functions to clear and replace the VectorModel's vector
This was requested by a customer recently and it seems rather straight-forward to implement and offer. `clear()` mirrors `std::vector::clear()` and `set_vector` mirrors the `set_vec` we have in Rust.
2024-01-19 16:58:20 +01:00
Simon Hausmann
d44717a11d doc: Add a section for targeting MCUs in the C++ documentation
Fixes #4180
2024-01-19 11:42:30 +01:00
Simon Hausmann
7a295d1b75 Bump Corrosion
Fixes #2508
2024-01-17 18:08:59 +01:00
Olivier Goffart
750a3033f8
C++ docs: add cmake reference 2024-01-15 17:36:29 +01:00
Olivier Goffart
4a1a7b1f7e Fix slint warnings in the docs 2024-01-12 09:24:51 +01:00
Olivier Goffart
9111946a82
Introduce slint::run_event_loop_until_quit
Closes #1499
2024-01-11 13:52:02 +01:00
Simon Hausmann
438b9afeaa
Reduce WindowAdapter API slightly (#4304)
Move the set_fullscreen function added to the WindowAdapter trait in 779aff0b39
to be a function in WindowProperties instead.
That way it'll be easier in the future to extend this with other window states without
having to modify or break the WindowAdapter trait API.
2024-01-09 18:55:06 +01:00
Simon Hausmann
aadac60a07 doc: Fix title case 2024-01-08 09:42:57 +01:00
Simon Hausmann
f5bf6e5dc0 Skia: Clean up pre present notify callback API
Move this back out of render() again and make it stateful in the renderer. Reduces the amount of book-keeping required and it's always the same callback anyway.
2024-01-04 10:35:09 +01:00