ui: initialise cursor in fields at the end

By convention and usability reasons, the cursor in a text field should
be initialised at the end of the string.
embed
Manos Pitsidianakis 2019-10-20 10:52:41 +03:00
parent cfe6138c44
commit 9de15284d8
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 2 additions and 2 deletions

View File

@ -10,9 +10,9 @@ pub struct UText {
impl UText {
pub fn new(content: String) -> Self {
UText {
cursor_pos: content.len(),
grapheme_cursor_pos: content.split_graphemes().len(),
content,
cursor_pos: 0,
grapheme_cursor_pos: 0,
}
}