Commit graph

886 commits

Author SHA1 Message Date
Tobias Hunger
e5ecb9cf6c infra: Test out mise
I found `mise` a tool to help manage development projects.
https://mise.jdx.dev/

It basically can manage ENV vars based on the directory you are in,
manages tools you need (and makes thoser available based on the
directory you are in), and allows to define simple tasks that can
then be shared between developers.

Tools can be found in npm, pipx, aqua, binaries on github, ...
and it tries to verify signatures and all that (if supported by the
repo the data comes from).

I replaces the entire autofix workflow with mise tooling and tasks,
just to give it a try :-)

To reproduce:

```sh
> cargo install mise # to get the tool itself

# Follow the necessary step
# https://mise.jdx.dev/installing-mise.html#shells
# to intergate into your shell

> cd /your/slint/folder

# Mise will now ask whether or not to trust this dir and prints the
# command needed to do so. Run that.

> mise install # Install all the tools defined in .mise/config.toml

# Add a .mise.local.toml with local overrides. Git will ignore this file.
# Or add tasks into .mise/tasks/local ... Git will also ignore those.

> mise run 'ci:autofix:**:all' # To run all the ci:autofix tasks.
```

It is so much fatser to see these checks fail locally than it is to
bother CI with them :-)
2025-03-20 16:33:00 +01:00
ogoffart
178cf21c2e Bump version number to 1.11.0 2025-03-18 09:48:22 +00:00
Simon Hausmann
154d877d9f CMake: Add support for overriding the translation domain via a target property
This is useful in environments such as esp-idf, where the component name is something awkward like __esp_idf_main or so.
2025-03-14 14:46:29 +01:00
scristall-bennu
be59032ecb
Use find_package to search for Corrosion (#7797)
First try to search for corrosion before fetching it
2025-03-05 19:19:47 +01:00
Olivier Goffart
d40a8b6d23 esp-idf: Be smarter about RGB888 and RGB565
This changes the default if the user has selected
`CONFIG_BSP_LCD_COLOR_FORMAT_RGB888` in their sdkconfig,
(which will result in build error if the buffer were passed as
Rgb565Pixel, or in garbage of the screen if the screen was configured
programatically to use rgb565 without calling `bsp_display_new` which is
unlikely if they set CONFIG_BSP_LCD_COLOR_FORMAT_RGB888)
2025-03-05 12:18:12 +01:00
Olivier Goffart
5ab791416b Implement Property::set_constant in C++ 2025-03-03 00:50:09 +01:00
Olivier Goffart
9571889861 esp-idf: assert that malloc succeeds when allocating line buffer
This allocates quite a lot of memory and is likely to fail.
Make it easier to debug
2025-02-28 07:59:22 +01:00
autofix-ci[bot]
eae4f21e24 [autofix.ci] apply automated fixes 2025-02-26 14:39:51 +01:00
Simon Hausmann
28da9bd996 C++: Clean up boolean accessible property getters
Share the code to convert the string to a boolean.
2025-02-26 14:39:51 +01:00
Olivier Goffart
da9fbebf18
esp-idf line by line renderer: use two line buffer
esp_lcd_panel_draw_bitmap is async so we should render in a different
buffer.
2025-02-25 21:37:36 +01:00
Simon Hausmann
beebffe829 C++ cleanup: Move the experimental render() overloads after the stable functions 2025-02-25 17:23:11 +01:00
Simon Hausmann
4d8f99e35d c++: Mark experimental target pixel buffer as experimental in the docs 2025-02-25 17:23:11 +01:00
Olivier Goffart
278e140147 Fix typo 2025-02-25 09:18:46 +01:00
Olivier Goffart
7390df1b47
ContextMenuArea: Intercept long press on Android 2025-02-24 18:27:25 +01:00
Simon Hausmann
f114ff28dd Rename TargetPixelBuffer::Pixel to ::TargetPixel 2025-02-24 17:02:10 +01:00
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