Skip to content

Commit 33d974c

Browse files
authored
Merge pull request #5560 from Textualize/bump2.1.0
bump 2.1.0
2 parents 855bec6 + f95c056 commit 33d974c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## Unreleased
8+
## [2.1.0] - 2025-02-19
99

1010
### Fixed
1111

@@ -16,7 +16,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
- Fixed flipped title colors in panel border https://github.com/Textualize/textual/issues/5548
1717
- Fixed detection of smooth scrolling https://github.com/Textualize/textual/pull/5558
1818

19-
2019
### Added
2120

2221
- Added `pointer_x`, `pointer_y`, `pointer_screen_x`, and `pointer_screen_y` attributes to mouse events https://github.com/Textualize/textual/pull/5556
@@ -2762,6 +2761,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
27622761
- New handler system for messages that doesn't require inheritance
27632762
- Improved traceback handling
27642763

2764+
[2.1.0]: https://github.com/Textualize/textual/compare/v2.0.4...v2.1.0
27652765
[2.0.4]: https://github.com/Textualize/textual/compare/v2.0.3...v2.0.4
27662766
[2.0.3]: https://github.com/Textualize/textual/compare/v2.0.2...v2.0.3
27672767
[2.0.2]: https://github.com/Textualize/textual/compare/v2.0.1...v2.0.2

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "2.0.4"
3+
version = "2.1.0"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/content.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,15 @@ def get_optimal_width(
371371
rules: RulesMap,
372372
container_width: int,
373373
) -> int:
374-
"""Get optimal width of the visual to display its content. Part of the Textual Visual protocol.
374+
"""Get optimal width of the Visual to display its content.
375+
376+
The exact definition of "optimal width" is dependant on the Visual, but
377+
will typically be wide enough to display output without cropping or wrapping,
378+
and without superfluous space.
375379
376380
Args:
377-
widget: Parent widget.
378-
container_size: The size of the container.
381+
rules: A mapping of style rules, such as the Widgets `styles` object.
382+
container_width: The size of the container in cells.
379383
380384
Returns:
381385
A width in cells.
@@ -385,11 +389,11 @@ def get_optimal_width(
385389
return max(line.cell_length for line in lines)
386390

387391
def get_height(self, rules: RulesMap, width: int) -> int:
388-
"""Get the height of the visual if rendered with the given width. Part of the Textual Visual protocol.
392+
"""Get the height of the Visual if rendered at the given width.
389393
390394
Args:
391-
widget: Parent widget.
392-
width: Width of visual.
395+
rules: A mapping of style rules, such as the Widgets `styles` object.
396+
width: Width of visual in cells.
393397
394398
Returns:
395399
A height in lines.

0 commit comments

Comments
 (0)