mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 05:14:48 +00:00
Implement basic focus handling
Similar to the mouse_grabber, we use a VisitChildrenResult field to track the focus item within a component. Unlike the mouse grabber however, it is set/cleared using dedicated focus events. The key event now routes the key event directly to the focus item. The focus can be requested via set_focus_item on a window, which the TextItem does.
This commit is contained in:
parent
aa5babffe1
commit
e5dfb3a4c0
19 changed files with 603 additions and 48 deletions
|
@ -23,6 +23,13 @@ inline void send_mouse_click(Component &component, float x, float y)
|
|||
&component.window);
|
||||
}
|
||||
|
||||
template<typename Component>
|
||||
inline void send_keyboard_string_sequence(Component &component, const sixtyfps::SharedString &str)
|
||||
{
|
||||
cbindgen_private::send_keyboard_string_sequence({ &Component::component_type, &component },
|
||||
&str, &component.window);
|
||||
}
|
||||
|
||||
#define assert_eq(A, B) \
|
||||
sixtyfps::testing::private_api::assert_eq_impl(A, B, #A, #B, __FILE__, __LINE__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue