Commit graph

4205 commits

Author SHA1 Message Date
Simon Hausmann
514c7f6886 wip 2025-10-30 10:55:39 +00:00
Olivier Goffart
e2670075fa C++: Fix close popup from deleted parents
Some checks are pending
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / slintpad (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
C++ part of #9722
2025-10-28 20:25:24 +01:00
Olivier Goffart
f07f9fcd70 C++: Fix crash when accessing C++ parent
C++ part of #3464
2025-10-28 20:25:24 +01:00
Olivier Goffart
b9bdd01532
Skia: Fix colorized tile rendering
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / slintpad (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
Regressed in 768c895ad4

Fixes #9860
2025-10-28 10:44:04 +01:00
Burhan Khanzada
33ab76918f
Add Touch events in WindowEvent (#9858)
for #4352
2025-10-28 10:11:27 +01:00
Olivier Goffart
ab66048efe
winit: Do not enable the x11/wayland feature through accessibility feature
Fix #9861
2025-10-28 09:20:19 +01:00
Ashley
da1689c29e
Experimental markdown rich text: render underlines, strikethroughs and link colors (#9749)
* Underscores and links

* Add color options

* Store links seperately

Gate the links field

* [autofix.ci] apply automated fixes

* Change fill_rectangle to use a brush instead

* Change if let to if is_some

* Fix skia

* Gate structs again

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-28 03:33:14 +13:00
U. Bruhin
677f0b1303 system-testing: Do not panic on TCP communication errors
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / slintpad (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
On any TCP communication errors between AUT and test server, do not
panic with unwrap() anymore but just close the connection and print
the error to stderr. So the application will not panic anymore when
the test server quits.

Reason is that the panic randomly happened during normal test execution,
probably during test shutdown phase. Even though the tests were
successful, on macOS a crash reporter dialog was raised due to the
panic, which is annoying. Fixing the panic will prevent the crash
reporter from unintentionally showing up.
2025-10-26 07:11:15 +09:00
Olivier Goffart
ad293efa4b Two ways binding to struct fields with C++ 2025-10-24 17:33:13 +02:00
Olivier Goffart
e11015e7b3 Two way binding with struct for the interpreter
Also fix #9765 while i'm at this by having a two way binding through a
Value for the struct
Fixes #9765
2025-10-24 17:33:13 +02:00
Olivier Goffart
0b994518b9 Two way bindings to struct fields (Rust only) 2025-10-24 17:33:13 +02:00
Olivier Goffart
c2e9ed5fd8 properties: fix dependency tracking of properties for two-way-binding with maps
Instead of changing the CURRENT_BINDING in the evaluate function from
the vtable, change it from the caller.

This requires the pointer to be passed to the evaluate to be `*const`,
which required a few changes in the ChangeTracker.
2025-10-24 17:33:13 +02:00
Olivier Goffart
6845255b68 WIP: core: two way bindings with mapping 2025-10-24 17:33:13 +02:00
ogoffart
cad0a8ea83 Bump version number to 1.15.0 2025-10-24 14:28:17 +00:00
Andreas Monitzer
eae027e936
Safe Area
Changelog: Added four new properties to the Window element for exposing the safe area to Slint and implement it for iOS.
Changelog: Adjust Android implementation of the window safe area to match the iOS implementation. This is a breaking change!

Fixes #9755
2025-10-24 12:24:45 +02:00
Andreas Monitzer
affbb7b9fa
Scroll Into View for Focused Item
Implement a "scroll to make points visible" function to Flickable, automatically scroll to the bounding box of an element when it gains focus.

ChangeLog: When resizing the window, try to keep the focus item visible if it's in a Flickable.
ChangeLog: When focusing an element that's not fully visible, try to scroll a parent Flickable so that it is.

Fixes #3067
2025-10-24 12:19:30 +02:00
Olivier Goffart
dcdcd8054d
Cleanup: de-duplicate ItemRc::map_to_* implementation
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
As discussed in https://github.com/slint-ui/slint/pull/9772#discussion_r2441739367
2025-10-23 14:54:43 +02:00
Olivier Goffart
2678e76942
Janitor: Dependency updates 2025-10-23 11:10:24 +02:00
Olivier Goffart
6826e8bbbb
core: make autoenums an optional dependency
It is only used for our Path algorithms
2025-10-23 11:09:34 +02:00
Alex
52375342c7
Image: fix incorrect rgba8 premultiply calculations (#9818)
Some checks are pending
CI / python_test (macos-14) (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
* fix: incorrect rgba8 premultiply calculations

I have corrected the rgba8 premultiply calculations in to_rgba8_premultiplied and to_rgba8, which should now be correct.

Fixes #9810

* feat: switch to integer math for premultiply calculations

I have moved out the calculations to premultiplied_rgba_to_rgba and rgba_to_premultiplied_rgba for testing and readability. I have also switched from floating-point math to integer math instead to avoid use of round.

* fix: make premultiply calculation functions private
2025-10-22 17:32:13 +02:00
ogoffart
db7e383e33 Bump version number to 1.14.1 2025-10-22 13:17:31 +00:00
Simon Hausmann
c1c89b3257 winit: Fix panic when accessing Palette.color-scheme during muda menubar build
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
When building the muda menubar, we end up evaluating bindings, which in
case of access `Palette.color-scheme` invokes
BuiltinFunction::ColorScheme, which tries to borrow the
winit_window_or_none for winit::Window::theme() access. Fix this by
narrowing the borrow_mut() access window to winit_window_or_none and
construct the muda menubar afterwards.

Fixes #9792
2025-10-22 10:05:39 +02:00
Ashley
7d19727b0c
MarkdownText: don't inherit from SimpleText (#9767)
* MarkdownText: dont inherit from simpletext

* Apply suggestions
2025-10-22 01:19:03 +13:00
Ashley
b958596398
Change render_layer to take a function that generates LogicalRects instead of just sizes (#9802)
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Change render_layer to take a function that generates LogicalRects
instead of just sizes

 fixes #9758.

 It changes the femtovg API for this from the other backends, but they don't seem to have the same issue in testing. Changing their function signatures might be a good idea for a future PR.
2025-10-20 21:46:04 +02:00
Ashley
3cc760b337
Use transforms in item_children_bounding_rect (#9795)
* Use transforms in item_children_bounding_rect

* Add casts
2025-10-21 05:15:09 +13:00
Simon Hausmann
5c8e49ae2f winit: Work around erroneous WindowEvent::Focused calls with have_focus == false on macOS 2025-10-20 23:45:52 +08:00
Simon Hausmann
7af2856665 winit: Fix macos system bar not always being initialized correctly
We remove the menubar when the window looses the focus, but due to
https://github.com/rust-windowing/winit/issues/4371 we see spurious
deactivations. Let's just not remove the old menubar.

When switching between multiple top-level windows the activation of
the new menubar replaces the old.

Fixes #9770
2025-10-20 23:45:52 +08:00
Simon Hausmann
91b3d165e4 Qt: Fix slow text rendering
Most text is rendered without a stroke but just a fill. This is currently detected by checking if the stroke brush is transparent, inside platform_text_stroke_brush(). For Qt, that check was missing, so in essence every Text element went through QPainterPath for stroking.

Centralize this decision in the shared parley code, to avoid repeating this mistake in future renderers.
2025-10-20 16:26:05 +08:00
Olivier Goffart
9f4b3cd778 live-preview: account for transformation when highlighting items
Some checks failed
CI / build_and_test (ubuntu-22.04, nightly) (push) Has been cancelled
CI / node_test (macos-14) (push) Has been cancelled
CI / node_test (ubuntu-22.04) (push) Has been cancelled
CI / python_test (macos-14) (push) Has been cancelled
CI / python_test (ubuntu-22.04) (push) Has been cancelled
CI / material-components (push) Has been cancelled
CI / cpp_package_test (push) Has been cancelled
CI / vsce_build_test (push) Has been cancelled
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Has been cancelled
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Has been cancelled
CI / mcu-embassy (push) Has been cancelled
CI / ffi_32bit_build (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / wasm (push) Has been cancelled
CI / fmt_test (push) Has been cancelled
CI / esp-idf-quick (push) Has been cancelled
CI / android (push) Has been cancelled
CI / miri (push) Has been cancelled
CI / test-figma-inspector (push) Has been cancelled
CI / python_test (windows-2022) (push) Has been cancelled
CI / cpp_test_driver (macos-14) (push) Has been cancelled
CI / cpp_test_driver (ubuntu-22.04) (push) Has been cancelled
CI / cpp_test_driver (windows-2022) (push) Has been cancelled
CI / cpp_cmake (macos-14, 1.88) (push) Has been cancelled
CI / cpp_cmake (ubuntu-22.04, stable) (push) Has been cancelled
CI / cpp_cmake (windows-2022, nightly) (push) Has been cancelled
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Has been cancelled
CI / wasm_demo (push) Has been cancelled
CI / tree-sitter (push) Has been cancelled
CI / updater_test (0.3.0) (push) Has been cancelled
Fixes #9760

Drag&drop over transformed item is still not working properly so this is
disabled
2025-10-18 11:59:09 +02:00
Arnold Loubriat
d79099072d
Set accessible-placeholder-text even when text input is not empty (#9773)
AccessKit now make sure to only expose the placeholder text when necessary, ensuring it is not presented if the text input is not empty. Workarounds in .slint files can therefore be removed.
2025-10-17 17:29:48 +02:00
Ashley
4a2c334ef3
Very basic Rich Text Support (#9733)
* Add is_markdown property

* Add builtins.slint line

* Add parse_markdown function

* Formatting

* Add strikethrough

* Assume that end tags always match and don't contain any additional info

* Layout rich text

* Formatting

* Handle code blocks, hackily do indentation and list points

* Remove dbg!

* Apply a few suggestions

* Write unit tests

* Do a 3rd layer of bullet point indentation

* Test nested lists

* Add markdown text component

* Add a paragraph_from_text function

* Remove MarkdownText if SLINT_ENABLE_EXPERIMENTAL_FEATURES is not set

* Mark as experimental

* [autofix.ci] apply automated fixes

* Add cfg flag to test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-16 09:26:43 +02:00
Olivier Goffart
b627b66168 partial_renderer: Fix visible:true-expr item being always dirty
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
The issue is that an element with visibility creates a `Clip` item as a
parent with a size of 0x0, and the clip property.
When the visible property becomes true, the tracker for this Clip item
will be dirty and will force everything inside to be re-drawn.
But since the `Clip` itself is no longer clipping and its size is 0, the
special code in `iterm_rendering::render_item_children` that handle the
clip specially will not kick in, and the `Clip` itself will not go
through the partial renderer, so its tracker will stay dirty forever
2025-10-15 16:33:59 +02:00
Olivier Goffart
5fd12cd3b4 Metrics collector: measure dirty region 2025-10-15 16:33:59 +02:00
Simon Hausmann
9d03bbb034 skia: Replace wildcard in objc2 version with same version used elsewhere in the file
A wildcard might not be accepted for crates.io uploads

(discussed with Olivier)
2025-10-15 15:29:31 +02:00
Andreas Monitzer
669272fce6 Disable objc2 encoding assertions on iOS Simulator (#9583)
The definition of MTLResourceID differs between iOS simulator and iOS device SDKs, which objc2-metal doesn't handle correctly.
See https://github.com/madsmtm/objc2/issues/795

Fixes #9583
2025-10-15 15:15:22 +02:00
Olivier Goffart
075c6fc67e
Mark Window::default-font-size as in
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
Without that, the compiler won't ever mark it as const, which is
necessary to avoid dependency from the runtime which query this property
quite often
2025-10-14 21:36:58 +02:00
Simon Hausmann
7384500f82 software renderer: Remove rustybuzz dependency
We're not going to go down the route and do full text layout with our own text layouting, so for the system-fonts case without parley, eliminate the rustybuzz dependency.

It'll remain a dependency with resvg, but that might go away in the future. The skrifa/read-fonts dependencies aren't new, they're part of the parley dependencies.
2025-10-14 20:22:40 +02:00
Simon Hausmann
eff2ddbbea software renderer: Fix severe slowness when using system fonts
With fontique collections, we rely on the shared source cache to be effective, to avoid repeatedly loading new fonts when creating new fontique::Collection instances. That cache however stores weak references to the blobs.

For parley based rendering, we keep one single fontique collection in the thread-local CONTEXTS in sharedparley.rs, which basically keeps strong references to font blobs we use.

When not using parley, we discarded the strong reference to the font blog after creating the fontdue font, which unfortunately meant that the font was discarded from the shared cache and loaded *every* time we queried the collection.
2025-10-14 18:49:38 +02:00
Simon Hausmann
6c103d9f5e parley: Fix line culling when word-wrap is enabled
With the following test case

```
export component TestCase inherits Window {
    Text {
        wrap: word-wrap;
        text: "Hello World";
        overflow: elide;
    }
}
```

The Text would get a max height at rendering time, for me it would be 12
pixels. The max_coord of the line metrics is 12 as well, but we'd cull
the line - erroneously. This patch changes it to use >= because the
max_coord is not an actual coord but a height (it's baseline + descent),
and it applies the culling only when we don't do pixel clipping.
2025-10-14 15:41:53 +02:00
Ashley
b31aba96ce
Software renderer: use parley (#9656)
* Store font index and blob instead of full fontique::QueryFont

* fontdue changes

* VectorFont takes blob and index

* Start implementing sharedparley::GlyphRenderer for SceneBuilder

* Change brush to be a color as the sw renderer can't do fancy gradients
anyway

* Implement trait fully

* Use trait instead if correct features are set

* Remove gl_x

* Slight fixes for the parley update

* [autofix.ci] apply automated fixes

* Add a RenderableVectorGlyph type in order to compile type enforce vector
alpha map and sdf stuff

* Add shared-parley to software-renderer-systemfonts feature

* Check font type before branching into legacy or parley codepaths

* Fix fill_rectangle offset

* Set alpha colors, physical clip

* Adjust font_size in swrenderer

* Apply rotation to selection rectangle

Switch order

[autofix.ci] apply automated fixes
Add missing mut

* Use sharedparley for text_size and font_metrics

* Put RenderableVectorGlyph behind feature flag

* [autofix.ci] apply automated fixes

* Remove unused font functions

* Allow rendering without parley

* Add missing cfg flags

* Use env variable instead

* Use font.index in glyph cache key

* Handle font matching and fallbacks differently

* Update references

* Put the parley disabled check behind a cfg flag

* Update references again

* Fix fill_rectangle rounding

* [autofix.ci] apply automated fixes

* Add bounds.xmin to target_rect

* Update references

* Update tests after bounds changes

* Round target_rect to fix rotate180 screenshot tests

* Update references yet again

* Get rid of rounding on target rect

* Use casts to properly truncate numbers. Hopefully tests now pass.

* Update references for hopefully final time

* Again

* Update references yet again

* Revert match_font, screenshot references

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-15 02:19:49 +13:00
Olivier Goffart
8f41824c98
TextEdit: change the has-focus property to be an output property (#9731)
It was an oversight to be `in-out`

As discussed in #9661
2025-10-14 14:38:38 +02:00
Olivier Goffart
3383640e99
Compiler: detect that the default-font-size is constent (#9727)
Some checks are pending
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
That way, we can optimize and inline expression that uses the `rem` unit
on MCU
2025-10-14 14:25:59 +02:00
Anton Helwart
d8ae84d276
Fix scrolling for ListViews with varying item heights (#9696)
The viewport_y of a ScrollView is saved when a mousebutton is pressed.
(inner.pressed_viewport_pos in flickable.rs and pressed-value in the
scrollview.slint files).

The saved value is used to compute the new position when the mouse is moved.

When a ListView loads new items and the average height of the items changes,
the viewport_height and viewport_y of the ListView change and
the saved value has to be adjusted to avoid 'jumping' during scrolling.

TODO:
- The fix is not implemted for the qt style yet.
- Maybe it would be better to check for property changes
  instead of saving the viewport size?


Fixes #9208
2025-10-14 14:25:15 +02:00
Tobias Hunger
e04989095d
compiler(rust): Make popup window opening and closing more robust (#9687)
* tests: Add a test for another popup-induced panic

* compiler(rust): Make popup window opening and closing more robust

Do not make the generated rust code trigger a panic when the parent no
longer exists.

Fixes: #9722 (rust only)
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-10-14 08:55:05 +02:00
Olivier Goffart
16c9ee9110 partial_renderer: Fix panic when item are created during the rendering pass
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.88) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
Fixes #9705
2025-10-13 16:44:53 +02:00
Simon Hausmann
aa65206319 parley: Fix elided text with trailing whitespace
For the elipsis computation we add up the advances of glyphs, which will infortunately include trailing whitespace. For that computation to be fair, we must therefore also include the trailing whitespace in the computed max width.
2025-10-13 15:38:25 +02:00
Simon Hausmann
caa4b82c5e FemtoVG: Fix regression with glyph rendering performance
Upgrade to 0.19.3 that fixes excessive hashing and ttf-parser creation.

Fixes #9601
2025-10-13 13:53:56 +02:00
Simon Hausmann
8a04403f2d parley: Fix panic when rendering large chunks of text
Harfrust stores certain offsets in u16 and will overflow with a panic for large texts:

    thread 'main' panicked at ...harfrust-0.3.1/src/hb/ot_layout_gsubgpos.rs:365:9:
attempt to add with overflow

To work around this, break text into multiple paragraphs.

cc #9601
2025-10-13 13:53:56 +02:00
Tobias Hunger
fe81e0af84
core: Do not panic when closing a popup during rendering (#9666)
* slint: Add test for panic on popups vanishing

* core: Remove popups from the list of open popups

... when a popups parent component gets deleted.

* core: Handle a popup window vanishing while rendering

... using an ItemWeak instead of having an extra sentinel
parameter to pass around.
2025-10-13 10:14:30 +02:00
Simon Hausmann
85692d1786 fontique: Fix font metrics queries with wasm builds
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.88) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-14) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.88) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / material-components (push) Blocked by required conditions
In wasm builds, we're responsible for populating the empty fontique collection with the one font we have. So register it with matching generic families.

Also, when creating the fontique query for a FontRequest, align the families in the same way as we do for text layout when specifying the families to parley's FontStack style.

This brings back the icons in menus in #9700 for wasm, as now the metrics are non-zero and thus the icon gets a height.
2025-10-12 11:52:43 +02:00