mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix formatting
This commit is contained in:
@@ -6,14 +6,18 @@ from rich.style import StyleType
|
||||
|
||||
|
||||
class Blank:
|
||||
def __init__(self, style: StyleType, width: int | None = None, height: int | None = None):
|
||||
def __init__(
|
||||
self, style: StyleType, width: int | None = None, height: int | None = None
|
||||
):
|
||||
self.style = style
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
def __rich_console__(self, console: Console, console_options: ConsoleOptions):
|
||||
render_width = self.width or console_options.max_width
|
||||
render_height = self.height or console_options.height or console_options.max_height
|
||||
render_height = (
|
||||
self.height or console_options.height or console_options.max_height
|
||||
)
|
||||
style = console.get_style(self.style)
|
||||
for _ in range(render_height):
|
||||
yield Segment(" " * render_width + "\n", style)
|
||||
|
||||
@@ -177,14 +177,19 @@ class Widget(DOMNode):
|
||||
)
|
||||
|
||||
if styles.has_border:
|
||||
renderable = Border(renderable, styles.border, style=renderable_text_style)
|
||||
renderable = Border(
|
||||
renderable, styles.border, style=renderable_text_style
|
||||
)
|
||||
|
||||
if styles.has_margin:
|
||||
renderable = Padding(renderable, styles.margin, style=parent_text_style)
|
||||
|
||||
if styles.has_outline:
|
||||
renderable = Border(
|
||||
renderable, styles.outline, outline=True, style=renderable_text_style
|
||||
renderable,
|
||||
styles.outline,
|
||||
outline=True,
|
||||
style=renderable_text_style,
|
||||
)
|
||||
|
||||
return renderable
|
||||
|
||||
Reference in New Issue
Block a user