Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for panel title #3401

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

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

## [13.7.1] - 2024-02-28

Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
level of experience, education, socioeconomic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards
Expand Down
7 changes: 4 additions & 3 deletions rich/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __rich_console__(
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
Expand Down Expand Up @@ -200,7 +201,7 @@ def align_text(

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
Expand Down Expand Up @@ -249,7 +250,7 @@ def align_text(

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)
Expand Down
Loading