orbtk
orbtk copied to clipboard
TextBlock: text wrap
Context
Possibility to wrap text on a TextBlock.
Problem description & Solution
If the measured length of a text is bigger then the width of the TextBlock and wrapping on the TextBlock is activated the Text should wrap in the next line.
Examples and MockUps
// .wrap("word_wrap"), .wrap("none") default is none
TextBlock::new().text("A very very very very very very very very long text").wrap("word_wrap").build(ctx)
The original issue was #285, unfortunately it was closed by the author.
Since the feature develop is on going, maybe another wrap mode that could be added is "truncate", where if the parent that contain the TextBlock is too small, the text is truncated adding, for example, 3 dots at the end, something like "1234567...". What do you think? Have a good day
TextBlock should also provide truncate
. It should also be possible to combine it with text wrap.
If you want you could create a separate issue.
Thank you for the input.