| 58 | self.style = style |
| 59 | |
| 60 | def __rich_console__( |
| 61 | self, console: Console, options: ConsoleOptions |
| 62 | ) -> RenderResult: |
| 63 | width = options.max_width |
| 64 | height = options.height or options.size.height |
| 65 | layout = self.layout |
| 66 | title = ( |
| 67 | f"{layout.name!r} ({width} x {height})" |
| 68 | if layout.name |
| 69 | else f"({width} x {height})" |
| 70 | ) |
| 71 | yield Panel( |
| 72 | Align.center(Pretty(layout), vertical="middle"), |
| 73 | style=self.style, |
| 74 | title=self.highlighter(title), |
| 75 | border_style="blue", |
| 76 | height=height, |
| 77 | ) |
| 78 | |
| 79 | |
| 80 | class Splitter(ABC): |