summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-07-22 20:48:03 +0700
committerLibravatar GitHub <noreply@github.com>2021-07-22 20:48:03 +0700
commit587dbbca421bc4b81f883aada063bf854c45f773 (patch)
treee212ff72e4ce0a4180b3defacd920865b47025fb /native
parentf076649fbb575ee036ab0b3f4511690e3379c115 (diff)
parent72d5d9b4bd03f6596369360018ee101a4a3053ae (diff)
downloadiced-587dbbca421bc4b81f883aada063bf854c45f773.tar.gz
iced-587dbbca421bc4b81f883aada063bf854c45f773.tar.bz2
iced-587dbbca421bc4b81f883aada063bf854c45f773.zip
Merge pull request #776 from AldoMX/master
Added `select_all` method to `TextInput`.
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/text_input.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index f06f057b..cec1e485 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -786,6 +786,11 @@ impl State {
pub fn move_cursor_to(&mut self, position: usize) {
self.cursor.move_to(position);
}
+
+ /// Selects all the content of the [`TextInput`].
+ pub fn select_all(&mut self) {
+ self.cursor.select_range(0, usize::MAX);
+ }
}
// TODO: Reduce allocations