Commit graph

213 commits

Author SHA1 Message Date
Olivier Goffart
e04f028c91 Fix default-font-size not working with PopupWindow with the Qt backend
We had code on the window to reset the default-font-size property to the
default from the renderer.
For the Qt backend, the PopupWindow being their own Window, this code
was activated also for the PopupWindow's hidden default-font-size
property, which caused all PopupWindow's font to not follow the
default-font-size

Fixes #8855
2025-07-09 17:08:24 +02:00
Simon Hausmann
15944a9a3f CI: Fix build
(ooops)
2025-06-25 21:25:22 +02:00
Simon Hausmann
a30368f0b9 system-testing: Improve error message when image encoding for snapshotting fails, by including the mime type 2025-06-25 21:23:13 +02:00
Simon Hausmann
3596cf3b5d system-testing: Fix fallback for window image snapshotting
Only fall back to PNG if the old protocol is used (where the string would be empty), otherwise fail with an error.
2025-06-25 21:23:13 +02:00
Simon Hausmann
f0c3df815e system-testing: Make the image format for snapshots configurable
Let the image crate pick an encoder by mime-type, otherwise fall back to png.

Renaming the field in the response is compatible, as only the tag
numbers are encoded. Adding a field to the request is also compatible as
every field is optional.
2025-06-25 21:23:13 +02:00
Simon Hausmann
ccf651cd3a system testing: Expose accessible-enabled and accessible-read-only 2025-06-19 08:47:41 +02:00
Simon Hausmann
864fbf01d8 system testing: Expose accessible-placeholder-text in the element properties 2025-06-17 13:42:25 +02:00
Simon Hausmann
504474f90b system-testing: Disable Nagle's algorithm to speed up round-trips
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, 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-13) (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.82) (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 / 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
Also write the leading message size header and the message body in one go to the socket, to reduce the risk of fragmentation.

Kindly suggested by @ubruhin
2025-06-16 17:50:24 +02:00
Olivier Goffart
c0cac46009 Add --generate-link-to-definition in the docs of all our published crate
This is a nice nightly rustdoc feature and we should make use of it
2025-06-06 21:47:36 +02:00
Olivier Goffart
23962b3e25
Upgrade cbindgen and use unsafe(no_mangle) attributes (#8539)
To be compatible with the 2024 edition, we need to wrap the
`no_mangle` attribute in `unsafe()`.

The parsing for that in cbindgen was only added in the version 0.28,
but we couldn't upgrade cbindgen before because of a regression in
cbindgen 0.27 that prevented us from upgrading.
Now that cbindgen 0.29 is released with a fix, we can prepare for the
2024 edition
2025-05-26 11:21:33 +02:00
MusicalNinjaDad
2a81357c03
slint-build: Add option to create CompilerConfiguration with_debug_info (#8489)
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-13) (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.82) (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
2025-05-21 08:17:09 +02:00
Simon Hausmann
b098bccc32 Propagate default font properties into PopupWindow 2025-04-24 09:18:45 +02:00
Simon Hausmann
b1f92f03d9 Add test case for font size propagation
...through a component factory, as we use that in the live-preview.
2025-04-24 09:18:45 +02:00
Olivier Goffart
78a3757b7f
Remormat all the toml file again to fix npm upload
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical

Add a .taplo.toml file

Also do not split feature array
2025-04-09 15:06:00 +02:00
Tobias Hunger
cd6f2e2cf2 ci: Format toml files
... using taplo with default settings

I tried this with 4 spaces indentation, but the patch is almost as
big as this one, so I went with default settings instead as that
is just easier:-)
2025-04-02 11:03:41 +02: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
Arnold Loubriat
cc91de2d38 Add the accessible-read-only property 2025-02-19 09:16:41 +01:00
Arnold Loubriat
90c337f1d1
Add AccessibleRole::Image and use it in the AboutSlint widget (#7593)
* Add `AccessibleRole::Image`

* Improve accessibility of the `AboutSlint` widget

* Filter out some images from the accessibility tree
2025-02-18 09:43:53 +01:00
Simon Hausmann
479bee7c87 Add support for exposing PopupWindow instances in the element tree when active 2025-02-10 13:57:55 +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
Olivier Goffart
2846c35055
TextInput: implement page up/down
CC #474
2025-02-06 14:52:28 +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
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
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Simon Hausmann
aa332202c5 Rename AccessibleRole.GroupBox to AccessibleRole.Groupbox
While unfortunate in casing, this is consistent with Checkbox, Combobox, and Spinbox.
2025-01-10 16:27:14 +01:00
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
Arnold Loubriat
49196728a7 Add AccessibleRole::GroupBox 2025-01-07 23:08:03 +01:00
Arnold Loubriat
3304df0f82 Add AccessibleRole::TabPanel 2025-01-06 09:30:11 +01:00
Olivier Goffart
a3dad45f0b Accessibility: rename a few properties after API review:
- Rename `accessible-selectable` and `accessible-selected` to `accessible-item-{selectable,selected}`.
   Because the property is for items in list rather than eg Text
 - Rename `accessible-position-in-set` to `accessible-item-index`.
 - Rename `accessible-size-of-set` to `accessible-item-count` and move
   the property to the container element rather than the item itself
2024-12-07 08:25:42 +01:00
Arnold Loubriat
97219c21bf Add the accessible-size-of-set property 2024-10-30 15:54:01 +08:00
Arnold Loubriat
67166fcc2d Add the accessible-position-in-set property 2024-10-30 15:54:01 +08:00
DataTriny
2de3b9d455 Add the accessible-enabled property 2024-10-25 10:20:09 +02:00
Arnold Loubriat
19f09950c2 Changelog: Add accessible-selectable and accessible-selected properties 2024-10-16 15:38:46 +02:00
Simon Hausmann
0b028bfb6f
Add support for a font-metrics property to Text/TextInput. (#6452)
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.

ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.

Closes #6047
2024-10-05 17:00:46 +02:00
Simon Hausmann
b2873a3d17 ui-testing: Add support for reading the computed opacity of elements
This is useful when the UI shows for example labels that appear and the screenshot for referenceing is meant to be taken when the opacity animation is complete and the value is (near) 1.0.
2024-09-19 11:28:18 +02:00
Arnold Loubriat
f01420258f Changelog: Introduce AccessibleRole::ListItem 2024-09-16 09:15:39 +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
Simon Hausmann
12f5343cd8 Add the window's root element handle to the window properties 2024-08-20 15:48:00 +02:00
Simon Hausmann
69e5a8a446 System Testing: Add descendent and element id/type/role matching messages 2024-08-20 15:48:00 +02:00
Simon Hausmann
cadfd9e104 Testing: Fix querying for elements by id when using _
The compiler normalizes `the_element` to `the-element`, so we also need to normalize that behind our API.
2024-08-05 10:32:21 +02:00
Simon Hausmann
7536a6df06 Attempt to fix testing publishing 2024-07-18 12:11:21 +02:00
Simon Hausmann
592ecc2f08 Permit publishing of testing crate 2024-07-18 12:06:35 +02:00
Simon Hausmann
9e8fccb742 system testing: Add support for dispatching pointer and key window events 2024-07-16 14:10:22 +02:00
Simon Hausmann
52f8249189 testing: Minor rename after a quick round of API review
- ElementHandle::match_descendants() becomes ElementHandle::query_descendants() to emphasize that this creates a query.
- Added ElementQuery::from_root() to remove the need to use the ElementRoot trait.
2024-07-15 11:30:34 +02:00
Simon Hausmann
790ae9c1bb Remove last use of ElementHandle::visit_elements from Rust testing API 2024-07-15 11:30:34 +02:00
Simon Hausmann
1c2a8f2d2f Replace uses of ElementHandle::visit_elements with matches 2024-07-15 11:30:34 +02:00
Simon Hausmann
b67fcce4a3 Add a new descendants api as well as deeper element queries to ElementHandle 2024-07-15 11:30:34 +02:00