The component properties might be accessed through different paths so we
may still reach a case where we have to borrow something that is already
borrowed
The property set by the user was not kept because the binding went the
wrong way.
Also remove the undocumented (and equaly not working)
TabWidget::current-focused property from the public API.
The current-focused property is initialized by the tab.
This commit can be reverted when we want to introduce it again.
There is a few bugs with the editable property:
- The text is not in sync with the model if the model changes after an
edit. (can be seen by making an edit and then sort)
- The highlight of the current row doesn't work properly
- We should probably only edit on double click or some shortcut instead
of just clicking
- The editable field exist but does nothing for the StandardListView
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
* move cpp StandardListViewItem to public namespace
* Fix missing C++ docs for StandardListViewItem
The struct is originally defined in Rust in model.rs and cbindgen creates the
compatible C++ declaration. For doxygen
to see it, it needs to be emitted into slint_generated_public.h.
* Improve the StandardListViewItem docs a little bit
* move cpp StandardListViewItem to public namespace
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Make sure that we return an unsigned for row_count() in C++ and Rust by ensuring an unsigned int model at creation time.
For the interpreter this "worked" by chance as casting a negative floating
number to usize automatically caps at zero, and all values are stored as f64. For safety this patch
applies the same fix though, to be on the safe side.
* Text only StandardTableView with column and rows
* Text editing of cells
* Sort by column ascending and descending
* Variants of the TableView for native, fluent and material
This is commit is just the output of running the syntax updater on the
files in the internal/compiler/widgets directory.
No extra manual steps were done.
Note: In order to run the updater, I did a hack so that the updater wouldn't
choke on internal item used by the styles by commenting out the check in
ElementType::lookup_type_for_child_element
This uses the approach discussed in Mattermost: The compiler understands
a SLINT_DEFAULT_FONT environment variable that can point to a path,
which overrides the fallback font that would otherwise come from the
system (and differ between test systems).
Instead of the ClippedImage. Because we use the colorize property more
often than the source property, and these are soon going to be even more
expensive
Fixes#2005
(Unfortunately, we can't make a driver test for this becasue the
behavior with the interpreter is different than with the compilers.
The interpreter errors out, while the compiler should just generate
nothing)
`consume()` does not advance whitespace, while `peek()` does. And the
`peek()` in the debug_assert meant that the behavior was different in
release and debug mode.
Use `expect` instead of consume as it skip over white space
Replace the intermediate NamedExport and SeenExport structs and the hash
table to find duplicates with a simpler algorithm:
1. Collect all exports into a vector, sorted, with duplicates
2. Eliminate duplicates and issue warnings accordingly and insert the
result into a second vector.
As a bonus, the resulting vector of exports is now sorted.