Commit graph

917 commits

Author SHA1 Message Date
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
Florian Blasius
0b26ca79b3
Cosmic: updated TabWidget style (#4953) 2024-03-27 12:03:02 +01:00
ogoffart
6bf40989d9 Bump version number to 1.6.0 2024-03-27 07:49:22 +00:00
Olivier Goffart
028d075199 Fix code generation when the if branch has a value and there is no else branch
Fixes #4942
2024-03-27 08:30:32 +01:00
Olivier Goffart
ea0227098a Throw an error when a callback aliases itself
Instead of panicking
Fixes #4938
2024-03-26 18:14:31 +01:00
Olivier Goffart
18eea8602a Fix insertion point of @children
Don't always appends at the end

Fixes #4935
2024-03-26 18:14:14 +01: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
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
42a4286048 Fix missing error when calling argb() with too many arguments
This is technically a breaking change if someone was calling it with too
many args by mistake, but i think it's fine to do this as a bugfix
2024-03-22 14:57:07 +01:00
Olivier Goffart
7e3c00be9c
Material style: fix text color
The text color for the text input that has the focus is the normal
"on-surface" color according to https://m3.material.io/components/text-fields/specs

Also fix the selection color of the TextEdit
2024-03-22 11:22:50 +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
Laurent Montel
7ab5d7f5a1 Add missing accessibility in common textedit 2024-03-21 17:14:38 +01:00
Montel Laurent
1a57e9fc7a
Fix accessible-role of ProgressIndicator (#4912)
In other styles it's defined as progress-indicator.
2024-03-21 15:42:31 +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
8628624296 fmt: Fix formatting of function argument declaration
Fix #4892
2024-03-20 22:35:53 +01:00
Olivier Goffart
db08970324 Keep the optimized ElementRc around.
They can be used in as the Popup's parent_element which we need to get
to the parent's enclosing Component.
Since that parent_element is not in a RefCell, we can't change it.
parent_element is a Weak so if its optimized item is removed, we will
not be able to access it.

Fix #4884
2024-03-19 11:58:36 +01:00