diff options
author | 2020-11-06 08:20:03 +0100 | |
---|---|---|
committer | 2020-11-09 20:32:50 +0100 | |
commit | f7d67598cb2ce4102211f54eca45dc49eabec7cc (patch) | |
tree | eea0624790bb82a74d2dfbc91927a15659719a7d /native | |
parent | da1a3eed1e6e67c2c0507e3b939e4aacdc06c19a (diff) | |
download | iced-f7d67598cb2ce4102211f54eca45dc49eabec7cc.tar.gz iced-f7d67598cb2ce4102211f54eca45dc49eabec7cc.tar.bz2 iced-f7d67598cb2ce4102211f54eca45dc49eabec7cc.zip |
Add textinput focus method
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/text_input.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 64182f2d..7af59ba1 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -716,6 +716,12 @@ impl State { pub fn move_cursor_to(&mut self, position: usize) { self.cursor.move_to(position); } + + /// Change the focus of the [`TextInput`] state. + /// [`TextInput`]: struct.TextInput.html + pub fn focus(&mut self, state: bool) { + self.is_focused = state + } } // TODO: Reduce allocations |