Commit graph

900 commits

Author SHA1 Message Date
Luke D. Jones
d4a3f77877 feat: color: add HSV methods to slint 2024-04-15 18:18:00 +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
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
Olivier Goffart
c553eb4398
compiler: Don't panic when using foo.focus(something)
Just ignore the case where focus has more argument that planed as it has
been reported as an error earlier.

Also fix the error message for calling member function with the wrong
number of argument to not include the base in the count.

Fix #4883
2024-03-19 11:06:08 +01:00
ogoffart
20c570ab1d Bump version number to 1.5.1 2024-03-18 08:55:01 +00:00
Olivier Goffart
5c381fd73e Fix clipping and border-radius
Fix #4854
2024-03-14 23:48:16 +01:00
Simon Hausmann
78771e0e37 Fix panic when loading unsupported images in Rust
The call to load the image already prints a message to stderr, so don't
panic but return a null image instead - neither when calling load_from_path
nor when decoding embedded image data.

cc #4846
2024-03-14 23:04:43 +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
Olivier Goffart
b844f76842 Add test and fixup color red/green/blue fields 2024-03-12 11:36:30 +01:00
Luke D. Jones
8c60cc74be feat: color: add channel properties to color
Add extra properties to the `color` type.
- `red`
- `green`
- `blue`
- `alpha`
2024-03-12 09:42:30 +01:00
Olivier Goffart
c3a2ad1c45 fmt: format two way bindings 2024-03-11 10:39:55 +01:00
Olivier Goffart
255dc59ef4 Rename @image-url(..., 9slice(...)) to @image-url(..., nine-slice(...))
As per API review:
 - In the Rust and C++ API we use `set_nine_slice_edges` because the getter couldn't start with 9
 - in english we spell number less than 10 with letters and this is a name
2024-03-07 17:01:57 +01:00
Wilston Oreo
bef532b5fc
Optional C++ namespaces (#4759)
Co-authored-by: Michael Winkelmann <michael@winkelmann.site>
2024-03-06 19:43:11 +01:00
Tobias Hunger
2e035fd0d1 compiler: Document function added in d0fc025bc8
... and remove code needlessly added in that commit,
too.
2024-03-06 14:25:21 +01:00
Tobias Hunger
d0fc025bc8 live preview: Do not drop on elements that can not have children
Slpit up `lookup_type_for_child_elemnt` (in the compiler) into the
part that looks at the element itself only (called `accepts_child_element`)
and the part that looks at the child.

When deciding whether we can drop something into another element in
the live preview, we know the child type is going to be OK, even when
the `TypeRegister` does not contain it yet (as it is not imported yet).
2024-03-06 12:15:10 +01:00
Florian Blasius
82d784a4d4
Cupertino: added pressed state to tab, fix animation (#4751) 2024-03-05 14:40:18 +01:00
Olivier Goffart
5fe68e1746 Fix animation when started from a different item tree
Fixes #4741

This commit move the property_binding_and_analysis from the inlining
pass to an associated funciton in the context.
Then re-use that from the rust and c++ generator to actually get the
right animation
2024-03-05 12:27:11 +01:00
Florian Blasius
22095ccf03
Cupertino TabWidget: Tweaked visual appearance (#4743) 2024-03-04 09:11:45 +01:00
Tobias Hunger
f62d5e0d4b Update internal/compiler/lib.rs
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2024-03-01 12:59:08 +01:00
Tobias Hunger
121cda19fd interpreter: Make sure the root document is in the TypeLoader
Refactor the code in the compiler a bit to allow using the
`TypeLoader` for the root document itself and use that in the
interpreter.

You need to run passes *before* the `TypeLoader` takes ownership
of the Document, so the `load_file` in `TypeLoader` needed a bit of
changing.
2024-03-01 12:59:08 +01:00