orbtk icon indicating copy to clipboard operation
orbtk copied to clipboard

[Feature request] Add text_alignment property to Text related widgets

Open kivimango opened this issue 5 years ago • 0 comments

Context

There are use cases where the user wants to align the text inside the widgets to the right border. As of now, only the TextBlock can be hacked to align its text to right setting horizontal_alignment to "end", but the horizontal_alignment is for aligning the whole widget inside its container.

Setting the text alignment of widgets built on top of TextBlock (like TextBox, Button) is problematic or impossible (how to reach the children of a child of a child's entity that does not have an ID?)

Problem description & Solution

Add a new text_property to the related widgets. The rendering should reflect the change. The child of the TextBox and the Button widgets should inherit from its parent.

Examples and MockUps

TextBlock::create().text("This text should be aligned to the right border").text_alignment("end).build(ctx)

right_align_1 right_align_2

kivimango avatar May 08 '20 08:05 kivimango