summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Paul Delafosse <paul.delafosse@protonmail.com>2020-11-06 08:20:03 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-09 20:32:50 +0100
commitf7d67598cb2ce4102211f54eca45dc49eabec7cc (patch)
treeeea0624790bb82a74d2dfbc91927a15659719a7d /native
parentda1a3eed1e6e67c2c0507e3b939e4aacdc06c19a (diff)
downloadiced-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.rs6
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