Commit graph

871 commits

Author SHA1 Message Date
Simon Hausmann
910d45a01f Fix window background fill
Don't blend the background but fill it when going through ProcessScene.
2025-02-24 17:02:10 +01:00
Simon Hausmann
247074b5e7 Simplify accelerated texture and rectangle fills
There's no need to split the areas to span lines.
2025-02-24 17:02:10 +01:00
Simon Hausmann
5518720391 Fix docs about fixed point format for source texture offsets 2025-02-24 17:02:10 +01:00
Simon Hausmann
f6d61c1b09 Improve API for C++ TargetPixelBuffer::draw_texture's blending color 2025-02-24 17:02:10 +01:00
Simon Hausmann
b896cc394b Fix the build with the experimental feature turned off 2025-02-24 17:02:10 +01:00
Simon Hausmann
efb2223db0 Some C++ docs for TargetPixelBuffer and related types 2025-02-24 17:02:10 +01:00
Simon Hausmann
9e515710ed Expose screen rotation in the TargetPixelBuffer's draw_texture as integral angle 2025-02-24 17:02:10 +01:00
Simon Hausmann
df6c99871d Change TargetPixelBuffer's draw_texture function to take a data structure instead of many arguments 2025-02-24 17:02:10 +01:00
Sam Cristall
491cb2f911 Add span_y to draw_texture to fix partial texture draws 2025-02-24 17:02:10 +01:00
Sam Cristall
3855cf6b9c Add draw_texture/process_texture and use accelerated fill_rectangle for background draw 2025-02-24 17:02:10 +01:00
Simon Hausmann
fbee7f9566 WIP: Start wrapping TargetPIxelBuffer in C++ 2025-02-24 17:02:10 +01:00
Olivier Goffart
c3e32c1665
Don't enable image-default-formats by default, remove compat-1-10 feature
We decided that the compatibility with people having enabled the extra
format in image 0.24 [1] is not worth it compared to the extra compilation
time most people gets by default when they don't need this feature.
(Which is less than 10% slower when the feature is enabled)

Since then there is no need for compat-1-10, remove it

[1] by depending directly on image 0.24 in their Cargo.toml and enabling
the features, which will not work with Slint 1.10 that now use image 0.25
2025-02-22 11:15:18 +01:00
Olivier Goffart
290468fb55 C++: Stabilize line by line renderer
Fixes https://github.com/slint-ui/slint/issues/7505

ChangeLog: C++: Added `SoftwareRenderer::render_by_line`.
2025-02-21 16:24:03 +01:00
Simon Hausmann
ecd8f8d00b
Add support for nightly esp-idf builds (#7687) 2025-02-21 12:19:23 +01:00
Olivier Goffart
1e814c9bdc
Stabilize the sdf-fonts feature
Enable the SDF feature by default in our compiler binaries

(Still disabled by default for other users because it takes up compile
time for something they probably don't need)
2025-02-19 21:24:53 +01:00
Arnold Loubriat
cc91de2d38 Add the accessible-read-only property 2025-02-19 09:16:41 +01:00
Olivier Goffart
e5c27d57ca esp-idf: Fix rendering of rotated and single buffering
... or byte swapped.

We need to take the right stride which might be the height if it is
rotated

https://github.com/slint-ui/slint/issues/7597#issuecomment-2661975754
2025-02-19 09:11:39 +01:00
Olivier Goffart
07803ccd6c
C++: support for RGB8 in the line by line rendering
Note: this adds a mendatory template parametter to the
(experimental) `render_by_line` function.
I tried to get the PixelType auto-detected from the callback but i
didn't manage
2025-02-19 09:11:10 +01:00
autofix-ci[bot]
650e0ef775 [autofix.ci] apply automated fixes 2025-02-16 14:04:13 +00:00
Olivier Goffart
4f4bc787fb
esp-idf: deprecate old slint_esp_init variant and restore 1.6 compatibility
Only support the one that take a configuration

ChangeLog: esp-idf: Deprecate old version of `slint_esp_init` and restore 1.6 behavior with regards to color swap

Fix: #7597
2025-02-11 12:54:39 +01:00
Simon Hausmann
a8909dfbfa Revert "stm32: Fix compilation with newer STM BSPs"
This reverts commit af2f8a5ab8 as it
breaks the build with the STM32H7 BSP. This needs to be solved
differently.
2025-02-08 23:18:08 +01:00
Simon Hausmann
af2f8a5ab8 stm32: Fix compilation with newer STM BSPs
Neither the BSP_LCD_Relaod typo nor the legacy #define is present in newer BSPs anymore.
2025-02-07 18:19:58 +01:00
Olivier Goffart
c0b72cad2f
ContextMenu: show submenu on hover after a timeout
This means that the parent menu still get the mouse events

Also add the ability to close the menu programmatically
2025-02-07 13:27:32 +01:00
Olivier Goffart
7104c6e88e
Rudimentary key navigation of the popup menu (#7556)
Closing the menus is still not implemented
2025-02-07 10:01:40 +01:00
Yuri Astrakhan
6324b35e94 Auto-fixed clippy::needless_borrow
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrow

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_borrow

cargo fmt --all
```
2025-02-07 09:02:45 +01:00
Yuri Astrakhan
bcb2953f00 Auto-fixed clippy::unnecessary_map_or
This is a hacky approach, but does help a lot with the tedious fixes.

See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or

```
__CARGO_FIX_YOLO=1 cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or

cargo fmt --all
```
2025-02-07 09:02:31 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Arnold Loubriat
358e42a8d5 Add the accessible-action-expand action 2025-02-03 20:32:45 +01:00
Arnold Loubriat
f30f953ffd Add the accessible-expanded property 2025-02-03 20:32:45 +01:00
Arnold Loubriat
53fd7b12e4 Add the accessible-expandable property 2025-02-03 20:32:45 +01:00
Olivier Goffart
094ff8f56b Refrersh the menubar when one of the property get changed
Install a PropertyTracker to update the shadow tree if something changes
2025-01-30 17:43:33 +01:00
Olivier Goffart
010126992e MenuItem with for and if 2025-01-30 10:08:22 +01:00
Simon Hausmann
67940f8ff9 Fix cross-compilation of slint-compiler in Yocto environments (or when CC, etc. are set)
Don't enable jemalloc when cross-compiling.

Fixes #7463
2025-01-29 09:05:56 +01:00
Olivier Goffart
62e9111842 Fix C++ slint_register_font_from_* functions regarding to the error string
The C++ code already instentiate a `SharedString` on the stack, we are
not supposed to ptr::write into it.
Lickyly this didn't have any effect because the default constructed
string can be leaked without problem, but better be correct.

Also aboud temporary String allocation
2025-01-27 19:22:00 +01:00
Olivier Goffart
c98d234b9e Janitor: Always use `#![no_std] for runtime lib
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.

The downside is that there is a bit of churn in the tests
2025-01-27 19:22:00 +01:00
Olivier Goffart
3d664578dd Fix ListView implementation in C++
Regressed in commit 4da79ac69a
2025-01-22 19:52:02 +01:00
Olivier Goffart
7e37f19e2c ListView: fix continuous redraw with fluent style
Because we set the viewport-width several time to different value during
the layouting of the ListView, it will cause this property to always be
dirty. In particular, this causes permanent restart of the fluent's
scrollbar animation on the size of the handle, causing continous
repaints.
2025-01-21 14:31:55 +01:00
Olivier Goffart
4da79ac69a Fix layouting of huge ListView with millions of items
The problem is that the precision of f32 for coordinate wouldn't be
accurate enough with such big viewport to put the elements so that they
are next to eachother.
So put the elements relative to the Flickable instead of relative to the
created moving viewport Rectangle.

Fixes #3700

Note that the ListView still use f32 for the scrollbar value, meaning
that at some point, the wheel stops working as the wheel increment is
smaller than the f32 increment, and scrolling becomes somehow fuzzy.
But this only happens after one more billions pixels now, so one can
have more than 50 millions of elements without much problems
2025-01-20 17:41:38 +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
Olivier Goffart
5c6ddfdda9 C++ tests: disable false positive warning on more recent version of GCC
CC #7358

(Test for version 14 because that is what i have installed and haven't
tested any other versions)
2025-01-14 09:54:51 +01:00
Simon Hausmann
43db58aaf5 Bump MSRV to 1.82
Fixes #7254
2025-01-14 08:33:21 +01:00
ogoffart
c83af3ca5c Bump version number to 1.10.0 2025-01-13 13:38:41 +00:00
Simon Hausmann
6e81f90d33 esp-idf: Remove unecessary template parameter from EspWindowAdapter 2025-01-13 14:27:37 +01:00
Simon Hausmann
f5909807ea esp-idf: Rename SlintPlatformConfiguration's color_swap to byte_swap and deprecate color_swap_16 2025-01-13 14:27:37 +01:00
Simon Hausmann
287bd922a4 Apply Olivier's suggestion for the byte_swap field's behaviour for RGB8 displays. 2025-01-13 14:27:37 +01:00
Simon Hausmann
1f205dffe7 esp-idf: Document SlintPlatformConfiguration's PixelType parameter 2025-01-13 14:27:37 +01:00
Simon Hausmann
5ef3fb8b26 esp-idf: Implement color_swap for RGB8 pixels
Use Olivier's great trick to rename color_swap_16 to color_swap via
union.
2025-01-13 14:27:37 +01:00
Simon Hausmann
8903124239 esp-idf: Add support for RGB8 rendering
... by making SlintPlatformConfiguration a template and using a deduction guide to make it source compatible (Olivier's magic :)
2025-01-13 14:27:37 +01:00