mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Simplify the destructor of generated C++ components
Similar to the parent commit, avoid creating an array of item refs and pass the item tree instead to a run-time helper function.
This commit is contained in:
parent
67579ec560
commit
096fbab93d
3 changed files with 21 additions and 23 deletions
|
@ -113,9 +113,11 @@ public:
|
|||
float scale_factor() const { return sixtyfps_windowrc_get_scale_factor(&inner); }
|
||||
void set_scale_factor(float value) const { sixtyfps_windowrc_set_scale_factor(&inner, value); }
|
||||
|
||||
void free_graphics_resources(const sixtyfps::Slice<ItemRef> &items) const
|
||||
template<typename Component, typename ItemTree>
|
||||
void free_graphics_resources(Component *c, ItemTree items) const
|
||||
{
|
||||
cbindgen_private::sixtyfps_windowrc_free_graphics_resources(&inner, &items);
|
||||
cbindgen_private::sixtyfps_component_free_item_graphics_resources(
|
||||
vtable::VRef<ComponentVTable> { &Component::static_vtable, c }, items, &inner);
|
||||
}
|
||||
|
||||
void set_focus_item(const ComponentRc &component_rc, uintptr_t item_index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue