iced
iced copied to clipboard
Text content by cow
#1050
Replace Text.content
from String
to Cow<'a,str>
to reduce String
allocation.
#1050 Replace
Text.content
fromString
toCow<'a,str>
to reduceString
allocation.
I wounder if it's feasible to do alter TextInput
message to be (String,TInputEvent)
where TInputEvent contains various things that can happen with text input, like copy-paste events, char
insertion at a position, etc.
Imagined API:
enum TInputEv {
Paste( fn(&mut String) ), //this writes paste content to the string; when it's emmited message's `String` still contains old value
Insertion{ at: Range<usize>, content: String} // range here indicates which indices of original string are going to be changed, content is payload; old value is still unchanged
KeyPress(char) //technically a subset of previous, but this is so common that it deserves it's own variant, I think
}