Add a clear-focus()function on all elements that have a focus() function

This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
This commit is contained in:
Simon Hausmann 2024-04-24 16:45:47 +02:00 committed by Simon Hausmann
parent e10e97c944
commit 31767eb6ab
21 changed files with 268 additions and 23 deletions

View file

@ -93,10 +93,10 @@ public:
items, &inner);
}
void set_focus_item(const ItemTreeRc &component_rc, uint32_t item_index)
void set_focus_item(const ItemTreeRc &component_rc, uint32_t item_index, bool set_focus)
{
cbindgen_private::ItemRc item_rc { component_rc, item_index };
cbindgen_private::slint_windowrc_set_focus_item(&inner, &item_rc);
cbindgen_private::slint_windowrc_set_focus_item(&inner, &item_rc, set_focus);
}
template<typename Component>