Both structure are bascially the same and only used internally, no need
to have the two.
The only difference was that one had the modifiers and the other one
not. But we can just set the modifier at the point we were converting
between the two.
Regression noticed in this line:
3f97d98bff/ui/tabs/downloads.slint (L77)
The following used to work:
```slint
import { Button, VerticalBox } from "std-widgets.slint";
export component Demo {
in property <[int]> mods;
VerticalBox {
alignment: start;
for xxx in true ? mods : [] : HorizontalLayout { alignment: center; Button { text: "OK!"; } }
}
}
```
But we fixed array conversion and this caused a regression with empty
array
This fixes a couple of bug:
- Bug #3740 happens because `Repeater::model_set_row_data` did not use
the inner.offset to get the instance (So that's the `val == 106` part
of the test)
- But I went ahead and also tested what happenned if you changed the
model from the "outside" using the `model[i] = `, and that was not
implemented, hence the move of the code from
`Repeater::model_set_row_data` to `RepeaterTracker::row_changed`,
That does need Pin though, so Pin was added everywhere
- C++ is not affected by bug #3740, because because the C++ listview
don't do the "allocate only visible" optimization. But the
"val == 1106" part of the test would fail so this patch also moces
the update from `model_set_row_data` to `row_changed`.
But following that we don't set the state as Dirty in `row_changed`,
the write_to_model test started filling because the `row_added`
function was missing an update of the index on every further items
The change in the interpreter prevent a borrow_mut from causing trouble.
The Value really don't need to be in a RefCell anyway
Fix#3740
In `ItemRc::find_sibling` we currently do:
1. get the range
2. check that the next index is within the range
3. call `get_subtree`
The problem is that get_subtree itselg will call 'ensure_updated' which
will do the relayout of the ListView and may get a different range of
element.
So don't query the range before and just have get_subtree to return an
empty ItemWeak if we are out of the actual range.
Couldn't really find a way to make a test since this is called from
the accessibility code which is hard to test as is
For #3700
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
As per commit 69feb7f0f40cc8dc4ca52777cf87a4c879d4b953 in meta-slint and
others, the Skia build is tricky because clang needs to be indirectly
and carefully instructed where gcc headers are located. In the Yocto
recipes, we go through lengths to set CLANGCC/CLANGXX correctly so that
the --target matches the triplet sub-directories in
recipe-sysroot/usr/lib and recipe-sysroot/usr/include/c++/$ver/ .
For aarch64 it's simple, there's usually just aarch64-$distro-linux, but
for example for armv7-$distro-linux-gnueabihf magic has to come
together: The gcc install dir is typically
recipe-sysroot/usr/lib/arm-$distro-linux-gnueabi (note the v7 and hf
absence). That means that's what --target needs to be when invoking
clang. But now the `hf` suffix is gone, which means clang relies on for
example -mfloat-abi=hard to avoid the use of gnu soft-float stubs. All
that's meticulously prepared in the Yocto recipe and placed for easy
consumption in CLANGCC/CLANGCXX environment variables. Therefore, when
those environment variables are set, don't overwrite them in
CORROSION_ENVIRONMENT_VARIABLES.when those environment variables are
set, don't overwrite them in CORROSION_ENVIRONMENT_VARIABLES.
and their related name.
Also move the component module in the item_Tree module
register_component -> register_item_tree
ComponentItemTree -> ItemTreeNodeArray
For #3323
Rationale from that issue:
Right now, we use the term `component` in the Slint language and in the compiler to be a a tree of elements that can be used as an element in a .slint file.
The term is also currently used in the runtime as a tree of runtime Items that are allocated together. (declared in ComponentVTable)
But there are no 1 to 1 mapping between a `component` in the slint language, and a runtime Component.
(for example, the items behind a `if` or `for` or `PopupMenu` are in a different runtime component. And `component` declared in Slint are often inlined)
So we should rename the internal runtime `Component` to `ItemTree`
The currently public `slint::ComponentHandle` wraps the "root" of the ItemTree, but that's ok because it is generated from a .slint `component`, so it doesn't change name
This reverts commit 292f487815.
Olivier had the brilliant idea of preceeding the path with a slash
on the Yocto side, so we can go back to the correct "type".
This reverts commit 0773e51d92.
By the SLINT_COMPILER being a `FILEPATH`, cmake will convert any
relative path to an absolute path. That's not wanted for the Yocto
build, because there we pass
'$ENV{OECORE_NATIVE_SYSROOT}/usr/bin/slint-compiler', so that
the path is resolved dynamically against the environment variable that
the Yocto SDK sets.
CMake would convert this to an absolute path that points into the build
directory, i.e. it would be /home/blah/foo/\$ENV{...}
Commit 9b62b08ed6 fixed
https://github.com/slint-ui/slint/issues/1066 initially, but commit
1036c0d082 erroneously regressed this
again, because while Corrosion sets this property, it is only set on the
locally generated CMake target. We still need to propagate that also
into the installed CMake target, which this patch does.
When building with cmake, buildroot sets PKG_CONFIG_SYSROOT_DIR in its
toolchain file, and therefore it's only available at configure time but
not build time, which is when our dependencies need it.
Since commit 7947f233f1a744f5ce9dfdf44372727d4fefb50b in Corrosion,
cmake will default to ${CMAKE_C_COMPILER} for linking a cdylib,
which means that C must be enabled as a language in the project.
Previously, it tried C, CXX, and Fortran and picked the first one.
This moves most of the version information we need to update into one
place.
Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
... and to use an external compiler
For example, this is how one only build the compiler:
```
cmake .. -DSLINT_BUILD_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=/tmp/slint_compiler
make install
```
And this only build the runtime
```
cmake .. -DSLINT_FEATURE_COMPILER=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install_runtime
make install
```
And then this can be used in a project like so:
```
cmake .. -DCMAKE_PREFIX_PATH=/tmp/install_runtime/ -DSLINT_COMPILER=/tmp/install_compiler/bin/slint-compiler
```