Skip to content

Commit acb0ce9

Browse files
authored
Merge pull request #3401 from Textualize/fix-panel-title
fix for panel title
2 parents 26479c1 + 193c492 commit acb0ce9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Fixed `Table` rendering of box elements so "footer" elements truly appear at bottom of table, "mid" elements in main table body.
13+
- Fix styles in Panel when Text objects are used for title https://github.com/Textualize/rich/pull/3401
1314

1415
## [13.7.1] - 2024-02-28
1516

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as
66
contributors and maintainers pledge to making participation in our project and
77
our community a harassment-free experience for everyone, regardless of age, body
88
size, disability, ethnicity, sex characteristics, gender identity and expression,
9-
level of experience, education, socio-economic status, nationality, personal
9+
level of experience, education, socioeconomic status, nationality, personal
1010
appearance, race, religion, or sexual identity and orientation.
1111

1212
## Our Standards

rich/panel.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def __rich_console__(
144144
Padding(self.renderable, _padding) if any(_padding) else self.renderable
145145
)
146146
style = console.get_style(self.style)
147-
border_style = style + console.get_style(self.border_style)
147+
partial_border_style = console.get_style(self.border_style)
148+
border_style = style + partial_border_style
148149
width = (
149150
options.max_width
150151
if self.width is None
@@ -200,7 +201,7 @@ def align_text(
200201

201202
title_text = self._title
202203
if title_text is not None:
203-
title_text.stylize_before(border_style)
204+
title_text.stylize_before(partial_border_style)
204205

205206
child_width = (
206207
width - 2
@@ -249,7 +250,7 @@ def align_text(
249250

250251
subtitle_text = self._subtitle
251252
if subtitle_text is not None:
252-
subtitle_text.stylize_before(border_style)
253+
subtitle_text.stylize_before(partial_border_style)
253254

254255
if subtitle_text is None or width <= 4:
255256
yield Segment(box.get_bottom([width - 2]), border_style)

0 commit comments

Comments
 (0)