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
Re-use the cells but mark them as dirty, instead of re-creating them every time.
In the included test-case that provides behavior that's
more intuitive.
* Add `RequestedSize` and `RequestedPosition` enum to enable asking for
logical or physical size/position.
* Rename `Window::size()` to `Window::physical_size()`
* Make `Window::set_size(...)` take an `Into<RequestedSize>`
* Rename `Window::position()` to `Window::physical_position()`
* Make `Window::set_position(...)` take an `Into<RequestedPosition>`
* Change `WindowAdapter` and related classes to be able to handle
requests being made in the either physical or logical units.
Implement this for C++, Rust and node.
One key difference to the Rust way is what `slint::Window` means. In
Rust that holds the `WindowInner` and `slint::Window` is only exposed as
`&slint::Window`. This is possible because the component owns the
`Rc<dyn PlatformWindow>`, which has a function to return the
`&slint::Window`.
In C++ `slint::Window` is also exposed as `slint::Window&` in the
`window()` getter, but there's no way to get a reference to a C++
wrapper for the Rust `&slint::Window` that the `PlatformWindow` trait
returns. Therefore in C++ `slint::Window` wraps `Rc<dyn
PlatformWindow>`.
Previously: Window is an Rc<WindowInner>, which has an Rc<dyn
PLatformWindow> - and weak references the other way around.
Now: Rc<dyn PlatformWindow> is the root of window ownership. The impl
PlatformWindow has a slint::api::Window, which just holds a WindowInner.
This change is incomplete on a few levels, mainly that neither of the
code generators nor the interpreter is ported.
I want to track component structure changes in the window without
generating more code. So use a more generic name for the init_*_items
functions, so that I can add the functionality I need in there.
Also add a register_component to PlatformWindow and call that.
I want a more generic name as I want to do to track component structure
changes in addition to resource freeing and I do not want to add another
call into the generated code.
Implement basic accessibility (a11y) support, using the Qt backend.
_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_
Parts of this PR:
* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
Remove the `parent_item` function. After the recent changes that did not
return an item anymore and since the item tree is exposed, this function
was only used to find the repeater a component was created by.
So replace the old function with a new one that only returns the parent
node in the parent component.
This saves a few lines of generated code that is not used anymore.
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
Add accessors to the information necessary to stitch together the
Component-wide ItemTrees (which include DynamicNodes) into one logical
tree of Items.