In the test, `reexport.slint` depends on `bar.slint`
When parsing `reexport.slint` we shouldn't clear previously reported
error from previously parsed `bar.slint`. The errors are still there.
We try to only visit the bindings of used property.
The problem is that when we visit the element, not all properties have
been marked as used, yet. We have a chicken and egg problem.
So just visit all bindings even for property we haven't reached.
This is unfortunate that we have to do that, and we'd need a much
deeper analysis to do this properly.
Fixes#8144
By default it's enabled, of course. This property is not only added to
MenuItem, but Menu as well - since they can be nested. It's also
possible to select a disabled item, but it's hard to modify that since
it's logic is written in Slint. You should be prevented from activating
it with a tap or key press at least.
See #7791
We were not visiting properly the MenuItem from
`recurse_elem_including_sub_components_no_borrow`
(`recurse_elem_including_sub_components` was correctly modified before)
Fixes#8090
The tree-sitter test fails because the output contained `ERROR` as it matched this string
Commit cd6f2e2 reformated the .toml, but the 80 char width column is
judged too small to be practical
Add a .taplo.toml file
Also do not split feature array
You can not create this expression manually, but there
is a pass in the compiler that adds it to all set
properties in a compilation run.
All it does is basically associate an id with an expression,
so that we can then in a later step have the interpreter do
something with that information. Apart from that, it tries to
be as transparent as possible.
The LLR lowering removes that expression again, just so we can
be sure it does not end up in the generated live code.
So that we can pass the focus into the container when it first
shows.
I thought this would be super complex to do property! What a
nice surprise:-)
Fixes: #4055
Let further pass materialize them, and most likely remove them anyway.
That way, they can be properly set and read from the rest of the .slint
code.
Fixes#8080
Although std-widgets provides many properties that adapt to the current theme users who would like to go beyond these properties and do theme dependent changes are limited. One option would be to add even more properties to the Palette, however this would potentially bloat the object, it's not obvious what properties users care about and this approach doesn't scale. In many cases developers could simply create their own properties if they knew what the current runtime theme was.
This simple change allows an app to know what the current theme is and present theme appropriate UI's.
... using taplo with default settings
I tried this with 4 spaces indentation, but the patch is almost as
big as this one, so I went with default settings instead as that
is just easier:-)
This does some refactoring to allow builtin item functions to return a
value:
- builtin member functions are no longer BuiltinFunction, but they are
just normal NamedReference
- Move special case for them in the LLR/eval
Right now we always `lock().value()` it which is the equivalent of
`upgrade().unwrap()` in rust, this helps because it keeps the parent
alive when we are calling function in it.
Ideally we should also check that it wasn't deleted, but that's another
issue.
Fixes#7880
Adds methods to change a `string`'s case to lowercase or uppercase.
They use Rust's `to_lowercase` and `to_uppercase` `String` methods.
ChangeLog: Added string.to-lowercase and string.to-uppercase
Closes#7860
Don't merge a property with a global property if it has a change handler
as we can't mobe the change handler in the global
Fixes#7784
If two property are merged that each have a change handler, we must
merge the change handler. (Note that the order in which they are being
called is not deterministic)
Fixes#7747
Add two new float to string conversion methods that mimic
JavaScript's Number.toFixed() and Number.toPrecision().
They are implemented as no_mangle functions similar to the already
existing float to shared string conversion.
Closes#5822
There was an image like this:
```slint
height: 40px
Image {
width: parent.width;
height: self.source.height * 1px;
source: @image-url("....");
}
```
The `y` propery ended inlined like so:
`(40 - the_image.source.get().size().height)/float(2)`
but since height was `unsigned` the C++ rules means that the operation
happens as unsigned and we have an overflow. and `y` turned out to be
very big instead of slightly negative (for image whose height was larger
than 40)
This is required to fix closing popup with the Qt backend, as we use the
window_adapter as a hack to get the root window_adapter (as opposed to
the popup one)
(That function was only used for the ComponentContainer and was not
implemented for C++ before)
Note that this reinterpret a
`Option<slint::private_api::WindowAdapterRc>` to just a `WindowAdapterRc`
This is because `Option` is only forward declared in C++ as it is not
generaly `#[repr(C)]`, but we assume (and assert) the usage of a niche.
As reported in https://chat.slint.dev/public/pl/ihnwtdgp7fb75k4aj5ou3p4idc