Commit graph

205 commits

Author SHA1 Message Date
Daniel Stuart
436efaceea renderer: Use TextWrap enum for text_size function 2024-06-17 23:52:04 -07:00
Daniel Stuart
9f63d157d1 Add character wrapping for Qt Backend
This adds a new wrapping mode called `char-wrap`, which allows for wrapping at any character.
Currently, it only supports the Qt backend, with the other backends falling back to `word-wrap` when this option is selected.
2024-06-17 23:52:04 -07:00
Simon Hausmann
a1857e6154 system testing: add a unit test to verify that the manual AccessibilityRole mapping is always complete
The enum is non-exhaustive, but we can do an additional run-time check.
2024-06-14 07:46:36 -07:00
Simon Hausmann
142b1ebde7 System Testing: Expose the accessibility role of elements 2024-06-14 07:46:36 -07:00
Simon Hausmann
b7478bb88c Add i-slint-backend-testing to the list of published crates
(also add std to the required features of core, so it compiles out of
the box)
2024-06-14 03:54:56 -07:00
Simon Hausmann
a2e10f8c78 When trying to fetch an ElementHandle as part of a RPC, remove the tracked handle if it's not valid anymore
There's no value in keeping it.
2024-06-13 04:03:17 -07:00
Simon Hausmann
1c6aadeb30 Add support for setting the accessible value 2024-06-13 04:03:17 -07:00
Simon Hausmann
e071ba9e5b Add a way to invoke accessibility actions 2024-06-13 04:03:17 -07:00
Simon Hausmann
97343b22db Testing: Add the ability to locate elements by id and expose various properties 2024-06-13 04:03:17 -07:00
Simon Hausmann
4591ad8d57 Add plumbing for system testing 2024-06-13 04:03:17 -07:00
Simon Hausmann
319fa0381c
Doc: Fix stray backtick 2024-06-13 06:33:30 +02:00
Simon Hausmann
0347aae66b Add ElementHandle::accessible_role()
This allows querying for elements by their role/type.
2024-06-11 08:02:10 -07:00
Olivier Goffart
58826ddd94 Testing C++ API: add a visitor over the ElementHandle 2024-06-10 15:52:40 +02:00
Olivier Goffart
318c80b4f2 testing: only visit items that are visible and not fully clipped 2024-06-07 15:08:44 +02:00
Olivier Goffart
a780dd4905 Testing: Fix duplicated accessibility element
This fix the C++ todo test that wasn't run because of a typo

When an element is optimized in another one, only the first one should
report the accessible properties. (because element with accessible
properties cannot be optimized so they are always the first)
2024-06-07 13:18:12 +02:00
Olivier Goffart
e9deb00332 Testing API: Have a public rust visitor function 2024-06-06 16:12:53 +02:00
Simon Hausmann
28cff6628d Add a test for looking up elements by id that are conditional 2024-06-05 09:51:13 -07:00
Simon Hausmann
15b517a554 Emit a warning to stderr (debug_log) when using the ElementHandle API but there's no debug info present 2024-06-05 01:29:58 -07:00
Simon Hausmann
622991a627 Fix ElementHandle::find_by_element_id docs
Describe what an id is and provide an example.
2024-06-05 01:29:58 -07:00
Simon Hausmann
7af0e7ae7c Add C++ API for find_by_element_type_name 2024-06-05 01:29:58 -07:00
Simon Hausmann
1a8ce3c659 Add support for optimized rectangles in ElementHandle
Keep merging elements, but remember the boundaries in the debug info, separated by a slash.

Also fixed tests that rely on accessible-label being set only once. For example

```
Button { text: "foo"; }
```

will certainly have "foo" as accessible-label on `Button`, but its internal `Text` element has
an implicit "accessible-label" set to the same
value.

So don't rely on that for now but search by id instead.
2024-06-05 01:29:58 -07:00
Simon Hausmann
a752851d0f Expose element type names and ids in Rust and C++ 2024-06-05 01:29:58 -07:00
Simon Hausmann
4eef2d4936 WIP: Add find_by_element_type_name 2024-06-05 01:29:58 -07:00
Olivier Goffart
43a336b534 C++ part of element_ids
Simplify a bit the llr generation so that there is less code duplication
between Rust and C++
2024-06-05 01:29:58 -07:00
Simon Hausmann
73b5136f98 WIP: Search by qualified element id 2024-06-05 01:29:58 -07:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Simon Hausmann
fbc441c372 Fix invoke_accessible_increment/decrement_action docs
They invoke a callback, not change a property.
2024-05-27 18:52:16 +02:00
Montel Laurent
f63523f708
Add increase/decrease support test (#5224) 2024-05-14 10:40:12 +02:00
Montel Laurent
c37c9d4f26
Testing: Add minimum/maximum support (#5192) 2024-05-10 16:18:02 +02:00
Montel Laurent
f8f3316dc1
Allow to check checkable support (#5186) 2024-05-07 13:44:14 +02:00
Tobias Hunger
2e3b00e38e janitor: Fix some clippy warnings pre-release
Nothing that should be controversial, but the
`internal/compiler/builtin_macros.rs` could point to a thinko in the original
commit.
2024-05-06 16:47:14 +02:00
Olivier Goffart
15f09c9224 Testing: expose the description and the checked accessible property
also rename default_action to accessible_default_action
2024-04-26 15:09:37 +02:00
Simon Hausmann
0e854db0d0 Add some API docs to i-slint-backend-testing 2024-04-26 14:04:04 +02:00
Simon Hausmann
87e6da2131 Make ElementHandle::set_accessible_value easier to use
Take an impl Into<SharedString> so that it can be called with a string literal.
2024-04-24 10:39:03 +02:00
Simon Hausmann
d8c1096149 Testing: Change ElementReference to be weak
We don't want testing variables to affect the life-cycle of elements in the UI.
2024-04-24 10:39:03 +02:00
Olivier Goffart
475ced0a62 C++ testing API: Intreoduce the ElementHandle 2024-04-22 11:28:12 +02:00
Olivier Goffart
64404ceca2 accessibility: return an Option for accessible string values
So we can know whether the item had the property set at all or not
2024-04-19 11:23:26 +02:00
Olivier Goffart
d4741efac0 testing: rename the init function 2024-04-18 18:45:31 +02:00
Olivier Goffart
8030732f46 Refactor the testing backend
Move code around and gate the internal functions used in our own tests
so we can make the testing backend public
2024-04-18 18:45:31 +02:00
Olivier Goffart
583eadbdbc testing backend: API fixes 2024-04-18 18:45:31 +02:00
Olivier Goffart
adc9be8317 WIP: allow searching elements by accessible label in tests 2024-04-18 18:45:31 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Olivier Goffart
1d2201a7ce Janitor: Update the image crate
Note: this could be a breaking change if someone did

```
image = { version = "0.24", features = [...] }
```

To enable more features decoder of the image to support more file format
in slint
2024-04-15 12:11:54 +02:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Olivier Goffart
fa24283cd4 Add a few funciton to make SlintContext usefull
Make it possible to spawn future and run event loop with a SlintContext
handle
2024-01-29 15:34:48 +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
Tobias Hunger
2bdcbc8e9f
core: Add a double-click callback to the TouchArea (#4060)
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2023-12-08 12:12:41 +01:00
Tobias Hunger
3a87342073 testing: Add a method to the testing interface to query the mocked time
I find this helpful when debugging tests using mocked time.
2023-12-01 17:36:18 +01:00
Olivier Goffart
a266e63549 Testing: Add some tests for setting the mouse cursor 2023-11-23 07:25:46 +01:00