mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
@@ -1210,16 +1210,19 @@ class Widget(DOMNode):
|
|||||||
RenderableType: A new renderable.
|
RenderableType: A new renderable.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
text_justify = (
|
||||||
|
_get_rich_justify(self.styles.text_align)
|
||||||
|
if self.styles.has_rule("text_align")
|
||||||
|
else None
|
||||||
|
)
|
||||||
if isinstance(renderable, str):
|
if isinstance(renderable, str):
|
||||||
justify = _get_rich_justify(self.styles.text_align)
|
renderable = Text.from_markup(renderable, justify=text_justify)
|
||||||
renderable = Text.from_markup(renderable, justify=justify)
|
|
||||||
|
|
||||||
rich_style = self.rich_style
|
rich_style = self.rich_style
|
||||||
if isinstance(renderable, Text):
|
if isinstance(renderable, Text):
|
||||||
renderable.stylize(rich_style)
|
renderable.stylize(rich_style)
|
||||||
if not renderable.justify:
|
if text_justify is not None and renderable.justify is None:
|
||||||
justify = _get_rich_justify(self.styles.text_align)
|
renderable.justify = text_justify
|
||||||
renderable.justify = justify
|
|
||||||
else:
|
else:
|
||||||
renderable = Styled(renderable, rich_style)
|
renderable = Styled(renderable, rich_style)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user