orbtk icon indicating copy to clipboard operation
orbtk copied to clipboard

TextBlock: text wrap

Open FloVanGH opened this issue 4 years ago • 3 comments

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)

FloVanGH avatar Aug 12 '20 09:08 FloVanGH

The original issue was #285, unfortunately it was closed by the author.

kivimango avatar Aug 12 '20 18:08 kivimango

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

uniformbuffer avatar Aug 17 '20 11:08 uniformbuffer

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.

FloVanGH avatar Aug 18 '20 04:08 FloVanGH