Commit graph

1484 commits

Author SHA1 Message Date
Simon Hausmann
d03a6f0071 Fix Slider's released callback not being invoked when the user releases it outside the widget's boundaries
Fixes #5173
2024-05-09 14:14:09 +02:00
Olivier Goffart
0929e3dfc1 Slint: make the abs work with unit types 2024-05-08 19:04:22 +02:00
Olivier Goffart
5c3732c74e C++: fix string to float so that it doesn't depends on the current locale 2024-05-07 14:58:07 +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
af1aa2991e
Fix component that inherits from PopupWindow
This regressed in commit 12d904a71c
which changed the order of the pass to get the lower_popup pass before
the first inlining pass.
If by chance (which is likely if one have children), the component that
inherits from PopupWindow was inlined in that pass, it would be as
if it was not a component, and it would be removed from its parent.
But since it is no longer inlined, we need to support that case and
delay the removal when processing the component that holds that popup.
2024-05-06 13:20:25 +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
c5f857ffc9 Change callback: gate behind experimental flag 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
2e4d1f2427 WIP: work on changed callback 2024-05-02 22:25:53 +02:00
Olivier Goffart
32bf6608e9 Parse changed callbacks 2024-05-02 22:25:53 +02:00
Dirley Jordan
35b9c1e738
Fix a positive minimum causing an incorrect slider/spinbox value (#5148)
sets the default value to that of the minimum
2024-04-30 09:30:31 +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
a3df400308
Basic tests for the Button 2024-04-26 17:25:44 +02:00
Noah Sweilem
6ede27a364 Add text stroke properties to Text element 2024-04-26 13:16:19 +02:00
Simon Hausmann
10e5c228b7 Fix calling clear-focus() on non-focusable elements not producing an error 2024-04-26 11:09:11 +02:00
Simon Hausmann
d1dd89528b Simplify creation of focus() and clear-focus() forward functions from components to the inner focus forward element
... by sharing more code in the compiler.
2024-04-26 11:09:11 +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
Olivier Goffart
4856f387ee C++ Todo example: add test 2024-04-22 13:54:28 +02:00
Olivier Goffart
5a4713aa17 C++: add #pragma once to generated file 2024-04-22 13:06:05 +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
c2b3bbdf92 Accessibility: add accessible-label and accessible-set-value to LineEdit 2024-04-16 15:50:53 +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
bd112a3021 C++: fix code generation of functions that don't return anything
and whose expression return something. Otherwise we get an error:
`return-statement with a value, in function returning ‘void’`
2024-04-16 14:50:55 +02:00
Olivier Goffart
ecf66ca3f2 Fix @children from inherited base
Fix #5071
2024-04-16 14:50:16 +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
ab86683d3c Accessibility: add actions for the button and the spinbox 2024-04-16 12:58:31 +02:00
Olivier Goffart
0f05089d5e Polish the C++ and Rust HSV API 2024-04-15 18:18:00 +02:00
Olivier Goffart
f1192673cb Slint: use to-hsv() to access hsv color 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
4312ce8fc6 feat: color: apply HSV formatting suggestions 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
eb2b7bf178
Widgets: test that widgets have the same accessible-role in all styles (#5065) 2024-04-15 18:15:47 +02:00
Simon Hausmann
ae2e0197f8
Deprecate the use of StyleMetrics for users of the public API (#4947) 2024-04-15 17:07:05 +02:00
Olivier Goffart
8aac4fcc49 Qt style: Fix the Combobox has-focus should be out
But the Native one needs to be `in` so we can't use the Native as a base
anymore
2024-04-15 15:25:23 +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
notfirefox
2ee1ee435d Allow scrolling through tabs for all backends
This allows the user to use the scroll wheel to scroll through the tabs.
In order to do this I have made created a common TabBarBase and let all
other implementations of TabBar* inherit from it. I also used slint-lsp
to format the files (it did not like the inline comments).
2024-04-15 12:10:56 +02:00
Olivier Goffart
2c0ba2bc0f Compiler: properly transform property access from base expression in state
Fix #5038
2024-04-12 15:53:56 +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
Olivier Goffart
d1da3baa27
Spinbox: fix and test the behaviour on mousewheel
Scrolling up should increase the value, not decrease it.

The Qt behaviour was changed in #5010
2024-04-04 10:54:13 +02:00
Olivier Goffart
8900c17f2b Fix return statement within a cast expression 2024-04-02 15:00:32 +02:00
Olivier Goffart
523e1a161c WIP: More on support for accessibility actions
Continue with the core library support and the compiler support.

This hasn't been tested yet and is missing implementation in the
backends
2024-03-28 11:28:56 +01:00
Florian Blasius
b0549b50c6 (wip) Added accessibility_action and supported_accessibility_action to ItemTreeVTable 2024-03-28 11:28:56 +01:00
Florian Blasius
cd6e8ae253
Cosmic: fix reuse license issues for the icons (#4970) 2024-03-28 11:15:52 +01:00
Florian Blasius
dc5004f9c4 Cosmic: ListView and ScrollView design adjustments 2024-03-28 08:55:55 +01:00
Florian Blasius
fa7771710d
Cosmic: replace path icon in list item with svg (#4958) 2024-03-28 08:49:07 +01:00
Florian Blasius
748c7e6a8e
Cosmic: replaces path icon in ComboBox with svg. (#4957) 2024-03-27 14:05:48 +01:00