Commit graph

1483 commits

Author SHA1 Message Date
Simon Hausmann
90da6a9d7e Pick the Skia renderer over FemtoVG
If Skia is available, pick that over FemtoVG. We end up recommending
Skia for most customers, so it should be enough to enable the feature
and not require additionally setting the `SLINT_BACKEND` environment
variable.

This change also means that the live-preview in the language server will
default to Skia on desktop installations. On the downside, this means
that Slintpad and the VS Code extension for the web will be using a
different renderer (FemtoVG).
2024-05-03 12:22:10 +02:00
Olivier Goffart
5e634fda9f PropertyTracker: Pin the DirtyHandler 2024-05-02 22:25:53 +02:00
Olivier Goffart
e872c5c574 linuxkms: remove unused code
Caused warning with Rust 1.78
2024-05-02 18:37:25 +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
Noah Sweilem
3ae3da3a04 Fix formatting issues 2024-04-26 13:16:19 +02:00
Noah Sweilem
15b8e6c9fa Text stroking: implement hairline stroking when width is zero 2024-04-26 13:16:19 +02:00
Noah Sweilem
f51d91f9f1 Text stroking: check if brush is transparent instead of stroke width to disable rendering 2024-04-26 13:16:19 +02:00
Noah Sweilem
d9caef02e1 Qt text stroke implementation 2024-04-26 13:16:19 +02:00
Simon Hausmann
31767eb6ab Add a clear-focus()function on all elements that have a focus() function
This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
2024-04-26 11:09:11 +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
Olivier Goffart
13127dc71c Accessibility: Add support for accessibility-action-* callback (#5073)
Merge branch 'feature/accessibility'

 Conflicts:
	internal/compiler/widgets/cosmic-base/button.slint
	internal/compiler/widgets/cupertino-base/button.slint
	internal/compiler/widgets/fluent-base/button.slint
	internal/compiler/widgets/material-base/button.slint

Also updated license header in actions.slint
2024-04-16 15:02:25 +02:00
Olivier Goffart
4e580c6ea4 Accessibility: Remove the replace-select-text from the slint api
Because we don't support it in Qt and in our widgets yet.

Also accessible-action-set-value now takes a string because value is a
string (for the line edit)
2024-04-16 14:41:17 +02:00
Olivier Goffart
01e0f0c526
Accesibility: Implement the action in the backend (#5062) 2024-04-15 16:39:25 +02:00
notfirefox
e2aeb56263 Show focus for NativeComboBox 2024-04-15 15:25:23 +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
Tobias Hunger
8a19e13dec android: Support Android 12
Make the code by @matthewjrichey found in issue #5031 into a PR:

> [...] discovered that `AMotionEvent_getActionButton` is only available on
> Android NDK 33 (Android 13) or higher. I came up with a working fix for the
> problem, which is tested and working on Android 12.

Done-by: @matthewjrichey
2024-04-12 14:46:50 +02:00
Arnold Loubriat
d863893e62 Expose toggle buttons as such to AccessKit 2024-04-09 00:09:01 +02:00
Arnold Loubriat
e17b1fda8b Properly expose Switch as such in the accessibility tree 2024-04-08 08:41:47 +02:00
notfirefox
fb2bbd8d92 Check mouse button for qt widgets in input_event 2024-04-04 09:30:01 +02:00
notfirefox
6462d699af Fix scroll direction of spinbox for qt backend 2024-04-04 09:30:01 +02:00
notfirefox
45490fca21
Implement has_hover for NativeComboBox (#5001)
Closes #5000
2024-04-02 18:20:07 +02:00
notfirefox
ab2014c42a
Implement has_hover for NativeCheckBox
Closes #4998
2024-04-02 17:41:40 +02:00
Simon Hausmann
68083243b2
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine
which mode is active.
2024-03-26 15:44:22 +01:00
Olivier Goffart
1f961a997b android: add the menu with cut/copy/paste when there is a selection
Also implement clipboard in the backend (Fixes #4865)
2024-03-26 14:50:55 +01:00
Olivier Goffart
8c2a798630 Android: long press select word 2024-03-26 14:50:55 +01:00
Simon Hausmann
f27c185daf
Add a released callback to Slider (#4821)
The released callback is invoked when the user finished changing the value, for example
when the arrow key is released.

As a bonus, for the Qt implementation this fixes a few bugs in the keyboard handling:
  - Handle orientation
  - Implement click-to-focus
  - Emit released also on key release

Co-authored-by: Luke D. Jones <luke@ljones.dev>
2024-03-26 14:15:52 +01:00
Olivier Goffart
2b7834e7c9 android: attempt to fix build if the locale is not UTF-8
Reported in https://fosstodon.org/@Karcsesz@equestria.social/112141146083141613

The build would fail with
```
error: unmappable character (0xC2) for encoding US-ASCII
```
Because of the © in the comment
2024-03-24 10:12:08 +01:00
Simon Hausmann
ed2816331e
Add support for raw-window-handle (#4918)
Add a `raw-window-handle-06` feature to the Rust API crates, which adds support for version 0.6 of rwh to slint::Window, by delegation adding a `window_handle()` function that returns a struct that implements the corresponding traits from rwh.

HasDisplayHandle could also be provided on the backend, but that can be
done separately if needed.

This is only implemented for the winit backend right now.

cc #877
2024-03-22 14:25:05 +01:00
Olivier Goffart
a61cf5239d Android: support for Java8
Older version of java used stderr for the version.
(As seen in https://github.com/slint-ui/slint/issues/4904#issuecomment-2014798778)
2024-03-22 14:23:10 +01:00
Olivier Goffart
fb0046c231 android: show a proper error when the version is java is too old
Also support Java 8 that did not support the --release argument yet.

Fix #4904
2024-03-22 09:20:13 +01:00
Olivier Goffart
b46effe65c Android: selection handle
Have two selection handle when there is selected text
2024-03-22 09:19:53 +01:00
Montel Laurent
fc0e8faae9
Accessibility: use tab-list for the tabwidget (#4909)
* Don't show tabwidget as tab
2024-03-21 17:48:42 +01:00
Montel Laurent
da30fa2663
Add ListView accessibility role (#4911) 2024-03-21 15:20:43 +01:00
Montel Laurent
4844b84e0c
Add Treeview accessibility support (#4907) 2024-03-21 15:18:52 +01:00
Montel Laurent
c2517008d8
Add TextInput as accessibility role (#4899) 2024-03-21 13:39:31 +01:00
Olivier Goffart
9f6b837f7d android: fix cursor and handle color
On android, the handle is the same as the cursor color and the cursor
color is usually the "accent" color.
We can't know the accent color from the native code, but we know the
selection color which is the accent color with a lesser opacity.
2024-03-20 15:06:34 +01:00
Olivier Goffart
504fbed476 android: only show cursor handle when we click 2024-03-20 12:46:10 +01:00
Olivier Goffart
528f85509b android: Moving cursor handle 2024-03-20 12:46:10 +01:00
Olivier Goffart
291a0bdc66 WIP: android cursor handle 2024-03-20 12:46:10 +01:00
Olivier Goffart
a77c8d4397 Update internal documentation of the android backend
The backend is now exposed through the Slint crate. No need to document
how to use the private API anymore
2024-03-18 13:44:14 +01:00
Tobias Hunger
28b96ca6f6 janitor: manual cargo clippy fixes
Semi-random selection of clippy topics that were
uncontroversial before:-).

Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
2024-03-14 13:42:38 +01:00