mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Render fix
This commit is contained in:
@@ -697,8 +697,6 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
else:
|
else:
|
||||||
screen.detach()
|
screen.detach()
|
||||||
|
|
||||||
print(self._registry)
|
|
||||||
|
|
||||||
return screen
|
return screen
|
||||||
|
|
||||||
def set_focus(self, widget: Widget | None) -> None:
|
def set_focus(self, widget: Widget | None) -> None:
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ class Widget(DOMNode):
|
|||||||
|
|
||||||
renderable = self.render()
|
renderable = self.render()
|
||||||
options = self.console.options.update_width(width).update(highlight=False)
|
options = self.console.options.update_width(width).update(highlight=False)
|
||||||
segments = list(self.console.render(renderable, options))
|
segments = self.console.render(renderable, options)
|
||||||
# Cheaper than counting the lines returned from render_lines!
|
# Cheaper than counting the lines returned from render_lines!
|
||||||
height = sum(text.count("\n") for text, _, _ in segments)
|
height = sum(text.count("\n") for text, _, _ in segments)
|
||||||
self._content_height_cache = (cache_key, height)
|
self._content_height_cache = (cache_key, height)
|
||||||
@@ -1040,10 +1040,8 @@ class Widget(DOMNode):
|
|||||||
width, height = self.size
|
width, height = self.size
|
||||||
renderable = self.render()
|
renderable = self.render()
|
||||||
renderable = self.post_render(renderable)
|
renderable = self.post_render(renderable)
|
||||||
options = (
|
options = self.console.options.update_dimensions(width, height).update(
|
||||||
self.console.options.update_width(width)
|
highlight=False
|
||||||
.update(highlight=False)
|
|
||||||
.reset_height()
|
|
||||||
)
|
)
|
||||||
lines = self.console.render_lines(renderable, options)
|
lines = self.console.render_lines(renderable, options)
|
||||||
self._render_cache = RenderCache(self.size, lines)
|
self._render_cache = RenderCache(self.size, lines)
|
||||||
|
|||||||
Reference in New Issue
Block a user