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
parent
cfe6138c44
commit
9de15284d8
|
@ -10,9 +10,9 @@ pub struct UText {
|
||||||
impl UText {
|
impl UText {
|
||||||
pub fn new(content: String) -> Self {
|
pub fn new(content: String) -> Self {
|
||||||
UText {
|
UText {
|
||||||
|
cursor_pos: content.len(),
|
||||||
|
grapheme_cursor_pos: content.split_graphemes().len(),
|
||||||
content,
|
content,
|
||||||
cursor_pos: 0,
|
|
||||||
grapheme_cursor_pos: 0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue