From 7a38204cb51dee761792a6b086784602899f06df Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Mon, 1 Jul 2024 11:38:23 +0100 Subject: [PATCH] fix for panel title --- rich/panel.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rich/panel.py b/rich/panel.py index 95f4c84c..cc7dcddf 100644 --- a/rich/panel.py +++ b/rich/panel.py @@ -144,7 +144,8 @@ class Panel(JupyterMixin): Padding(self.renderable, _padding) if any(_padding) else self.renderable ) style = console.get_style(self.style) - border_style = style + console.get_style(self.border_style) + partial_border_style = console.get_style(self.border_style) + border_style = style + partial_border_style width = ( options.max_width if self.width is None @@ -200,7 +201,7 @@ class Panel(JupyterMixin): title_text = self._title if title_text is not None: - title_text.stylize_before(border_style) + title_text.stylize_before(partial_border_style) child_width = ( width - 2 @@ -249,7 +250,7 @@ class Panel(JupyterMixin): subtitle_text = self._subtitle if subtitle_text is not None: - subtitle_text.stylize_before(border_style) + subtitle_text.stylize_before(partial_border_style) if subtitle_text is None or width <= 4: yield Segment(box.get_bottom([width - 2]), border_style)