Commit graph

1507 commits

Author SHA1 Message Date
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
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +02:00
Olivier Goffart
dea51f2055 Android: fix content positioning
The getWindowVisibleDisplayFrame seems to return a rectangle in the screen coordinate and cut the room for the camera.
The problem is that the Window is somehow already displaced.
The insets seems to be a better way to get that value.

Fixes #5242
2024-06-03 16:53:29 +02:00
Olivier Goffart
b3181b05a2 Android: clear the native focus when the keyboard hides
Otherwise the keyboard will popup again when the app is switched to the
background and back.

Fixes #5235
2024-06-03 16:27:47 +02:00
Olivier Goffart
a1e7f85892 Android: Always hide cursor/selection handle when the keyboard hides
Fixes #5233
2024-06-03 16:21:47 +02:00
Arnold Loubriat
2e5ebe2668 Address review comments 2024-06-03 01:38:06 -07:00
Arnold Loubriat
f97de46c6f Set accessible min/max values on progress indicator widgets 2024-06-03 01:38:06 -07:00
Simon Hausmann
d183498c4e Add support for step-size to SpinBox rendered by the Qt style
Fixes #5325
2024-05-31 09:45:29 -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
Simon Hausmann
09cfd067dd Prospective fix for Qt style’s slider’s release callback
Like in the Slint impl, invoke only if previously pressed.
2024-05-09 14:14:09 +02:00
Montel Laurent
f8f3316dc1
Allow to check checkable support (#5186) 2024-05-07 13:44:14 +02:00
Simon Hausmann
b00752514c Skia: Don't use Vulkan by default also on linuxkms
Amends ac53049408
2024-05-07 12:51:41 +02:00
Olivier Goffart
ebc4a14602 Update the android-activity crate by adding a new feature
The android-activity 0.5 no longer works with Rust 1.78 because it
asserts with
> slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`

Note that the documentation is build with the 05 feature because it also
build the winit backend crate in the same command that still depends on
android-activity 0.5 via winit
2024-05-07 12:48:49 +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
Simon Hausmann
ed0030efe8 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).

Cherry picked from commit 90da6a9d7e,
as the parent commit of this change fixes the issue that required
reverting it.
2024-05-06 12:01:05 +02:00
Simon Hausmann
518681cc02 Fix live-preview not working with Skia backend
When the winit backend creates the Skia renderer, there is no associated surface to render into. Only the winit Resume event would cause a call to set_window_handle() and thus surface creation. This was done for the earlier Android backend, and is generally good practice.

When running for example slint-viewer with SLINT_BACKEND=winit-skia, we would create the skia renderer (no surface), then start the winit event loop, get a resume event, initialize the surface, and it all works.

With the live-preview inside the lsp, we'd create the event loop, get a resume event (but there's no window yet), and then we'd create the skia renderer without a surface... ever.

It's not ideal, but for now call resume() explicitly since we _do_ have a winit window, and we're not calling this on Android anymore.
2024-05-06 12:01:05 +02:00
Simon Hausmann
43e3c57b3b Prospective fix for rustdoc warnings about unknown cfg's
Let cargo know about our internal cfgs.
2024-05-06 12:00:44 +02:00
Simon Hausmann
2acae37fd1 Revert "Pick the Skia renderer over FemtoVG"
This reverts commit 90da6a9d7e.

Somehow the live-preview with VS code stopped working with this change,
so revert it for now.
2024-05-06 09:45:31 +02:00
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