Commit graph

1368 commits

Author SHA1 Message Date
Florian Blasius
973ecac989 DatePicker: finished features 2024-06-06 09:03:50 +02:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02: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
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
8add2e4ebd element_ids: Can't return a SharedString by value from the vtable
also compile the LSP
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
Simon Hausmann
623bae7732 Internalize hack for dynamic translations change so that it also works for Rust apps 2024-06-04 04:33:10 -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
Olivier Goffart
f25a7c721a
Implement the Error trait for our errors 2024-05-31 13:13:12 +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
Michael Winkelmann
91484da803 Software renderer: Add comment about size of pixel_stride 2024-05-16 11:40:20 +02:00
Michael Winkelmann
8a4a99533d Software renderer: Fix doc typos for fn render 2024-05-16 11:40:20 +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
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
Olivier Goffart
0b5473de8d Fix no_std compile 2024-05-02 22:25:53 +02:00
Olivier Goffart
80f37a3acf C++ ChangeTracker implementation 2024-05-02 22:25:53 +02:00
Olivier Goffart
cadcd4caf4 Change callback: rust code generation 2024-05-02 22:25:53 +02:00
Olivier Goffart
ab53b1db2f More work on ChangeTracker 2024-05-02 22:25:53 +02:00
Olivier Goffart
b5b00fdf9f WIP: some runtime support for the change tracker
Introduce a ChangeTracker type, but it is not of any use now
2024-05-02 22:25:53 +02:00
Olivier Goffart
5e634fda9f PropertyTracker: Pin the DirtyHandler 2024-05-02 22:25:53 +02:00
Olivier Goffart
12d904a71c
Fix compiler panic with init in a component inlined into a repeater
The problem was that the code from #4322 inlined the init code in the
parent Component as at that point, the per-repeater component don't
exist yet.
Fix it by removing the workaround from #4322, but changing the order of
the passes so that the init code are already proccessed before any
inlining. This required to change the order of a bunch of passes.

Fixes #5146

As a drive-by, also add the missing C++ implementation of set_animated_value
for Brush that was discovered by the test. (Code wouldn't compile)
2024-04-29 15:34:12 +02:00
Olivier Goffart
5955d19706 Expose the individual rectangle in the dirty region 2024-04-26 14:45:23 +02:00
Olivier Goffart
f45bab6a3f swrenderer: Support multiple rectangles for the dirty regions
This allow to be much faster in the case two small area of the screen
changes.
2024-04-26 14:45:23 +02:00
Noah Sweilem
3ae3da3a04 Fix formatting issues 2024-04-26 13:16:19 +02:00
Noah Sweilem
6ede27a364 Add text stroke properties to Text element 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
Tobias Hunger
e10e97c944 live-preview: Add placeholder when removing the last eleemnt in a layout
Add a placeholder Rectangle into a layout whenever the last eleemnt is removed.
This makes sure we can drop into the Layout again.

Add infrastructure to find the parent element to ElementRcNode and move more
code into the ElementRcNode.
2024-04-25 10:28:15 +02:00
Olivier Goffart
f302142cd7 Rust Timer: Mark as !Send
The Timer cannot be moved between threads because the id is only valid
as part of the thread local of timers.

This is a breaking change. But if one had move timer between thread
before, it would have caused a bug.
2024-04-24 10:00:52 +02:00
Olivier Goffart
5deb3add63 swrender: Fix panic in some cases
Can be preproduced on the esp-idf usecases p4 demo when going into the
combobox dans doing a long press in the popup.

Same fix as 4296ca2afe but for line by
line
2024-04-23 16:17:46 +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
808b1ef946 Add a function to mark translated strings as dirty 2024-04-18 19:23:57 +02:00
Olivier Goffart
d4741efac0 testing: rename the init function 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
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
Simon Hausmann
305e02e334 Revert "Add a "image-default-formats" feature" and "Janitor: Update the image crate"
This reverts commit a159562ea7 and just
the version part of commit 1d2201a7ce to
downgrade image to 0.24 again.

This is not a straight revert, the workspace unification remains, just
the version is down to 0.24.

The update to the new image crate version causes two issues

- With the Xtensa Rust toolchain, a release build of the image crate
  takes excessively long (cargo +esp build --release in image-rs)
- The image crate version updates to zune-jpeg for JPEG decoding,
  which uses "cdylib" in crate-type, which in turn breaks the
  cross-compilation with Corrosion against a Linux sysroot, because
  the (unnecessary) zune-jpeg cdylib creation doesn't see corrosion's
  link args that provide the sysroot.
  (upstream PR at https://github.com/etemesi254/zune-image/pull/187 )

By reverting, this also closes #5068.
2024-04-16 14:55:50 +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
Mikhail Shabunin
385ec7d199
Use Color#mix for color interpolation (#5063) 2024-04-16 09:16:07 +02:00
Olivier Goffart
0f05089d5e Polish the C++ and Rust HSV API 2024-04-15 18:18:00 +02:00
Luke D. Jones
0b1ec5e4c9 Convert to struct field access and make HsvColor public 2024-04-15 18:18:00 +02:00
Luke D. Jones
d4a3f77877 feat: color: add HSV methods to slint 2024-04-15 18:18:00 +02:00
Olivier Goffart
01e0f0c526
Accesibility: Implement the action in the backend (#5062) 2024-04-15 16:39:25 +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
a159562ea7 Add a "image-default-formats" feature
To enable the feature from the image crate.
And enable it by default.
Because users of older version of slint may have enabled feature from
the image 0.24 crate. But since we upgrade to image 0.25, this these
format would not be supported by Slint. So enable them by default to
keep compatibility
2024-04-15 12:11:54 +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
ba3a1af167 Fix panic when the model row_data returns None
Closes #4839
2024-04-15 10:48:54 +02:00
Simon Hausmann
a61ca93cd1 doc: Attempt to clarify how the factor of color's mix() function is applied 2024-04-15 09:05:54 +02:00
Olivier Goffart
80b59653a2 Janitor: Fix warnings with no_std and nightly rust 2024-04-04 14:03:36 +02:00