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
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
So it doesn't appear in the LLR and the C++ codegen can be simplified.
In particular, this removes the need to throw/catch exception to handle return
across generated lambdas
- s/physical_size/size/ (consistant with the slint::Window API)
- remove const of virtual function (they don't need to be const and
make implementation potentially easier)
- Move the WindowProperties in it
- make sure the Platform::Clipboard type is properly documented
- Use the actual enum in the interface (even though it is
#[non_exhaustive] so we need to slience a warning)
CC: #3265
... and provide hints in there about implementing window close requests.
Note: The links to set_size() and set_position() are not resolved, as
these virtual functions are still missing from the WindowAdapter base
class.
- Fix pre-processor include search path setup so that pre-processing
slint.h finds slint_internal.h and (most importantly)
slint_generated_public.h for the feature defines.
- Add missing documentation that caused doxygen errors.