mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Add FocusEventReason to FocusEvent and add a select all on keyboard focus for TextInput (#8523)
Closes #5992 Adds the enum FocusEventReason and makes it an argument for FocusEvent. This reason could eventually be exposed in Slint to solve #8387. Using the focus reason tracking, I also added a select all on keyboard focus for TextInputs (except on macOS), which should close #5992. ChangeLog: TextInput selects its content when focused with the keyboard on Windows and Linux
This commit is contained in:
parent
370f72a15d
commit
c41d4a4df3
16 changed files with 225 additions and 86 deletions
|
@ -135,10 +135,11 @@ public:
|
|||
items, &inner);
|
||||
}
|
||||
|
||||
void set_focus_item(const ItemTreeRc &component_rc, uint32_t item_index, bool set_focus)
|
||||
void set_focus_item(const ItemTreeRc &component_rc, uint32_t item_index, bool set_focus,
|
||||
cbindgen_private::FocusEventReason reason)
|
||||
{
|
||||
cbindgen_private::ItemRc item_rc { component_rc, item_index };
|
||||
cbindgen_private::slint_windowrc_set_focus_item(&inner, &item_rc, set_focus);
|
||||
cbindgen_private::slint_windowrc_set_focus_item(&inner, &item_rc, set_focus, reason);
|
||||
}
|
||||
|
||||
void set_component(const cbindgen_private::ItemTreeWeak &weak) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue