mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
zero height renderables
This commit is contained in:
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
- `get_content_height` will now return 0 if the renderable is Falsey
|
||||
|
||||
## [0.65.2] - 2023-06-06
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -23,6 +23,7 @@ CodeBrowser.-show-tree #tree-view {
|
||||
#code-view {
|
||||
overflow: auto scroll;
|
||||
min-width: 100%;
|
||||
hatch: right $primary;
|
||||
}
|
||||
#code {
|
||||
width: auto;
|
||||
|
||||
@@ -118,7 +118,10 @@ class Timer:
|
||||
if timer._task is not None:
|
||||
timer._active.set()
|
||||
timer._task.cancel()
|
||||
await timer._task
|
||||
try:
|
||||
await timer._task
|
||||
except CancelledError:
|
||||
pass
|
||||
|
||||
await gather(*[stop_timer(timer) for timer in list(timers)])
|
||||
|
||||
|
||||
@@ -1345,13 +1345,17 @@ class Widget(DOMNode):
|
||||
|
||||
renderable = self.render()
|
||||
if isinstance(renderable, Text):
|
||||
height = len(
|
||||
renderable.wrap(
|
||||
self._console,
|
||||
width,
|
||||
no_wrap=renderable.no_wrap,
|
||||
tab_size=renderable.tab_size or 8,
|
||||
height = (
|
||||
len(
|
||||
renderable.wrap(
|
||||
self._console,
|
||||
width,
|
||||
no_wrap=renderable.no_wrap,
|
||||
tab_size=renderable.tab_size or 8,
|
||||
)
|
||||
)
|
||||
if renderable
|
||||
else 0
|
||||
)
|
||||
else:
|
||||
options = self._console.options.update_width(width).update(
|
||||
|
||||
@@ -10,5 +10,6 @@ class Label(Static):
|
||||
Label {
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-height: 1;
|
||||
}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user