MCPcopy
hub / github.com/Textualize/textual / _get_inline_height

Method _get_inline_height

src/textual/screen.py:1436–1458  ·  view source on GitHub ↗

Get the inline height (number of lines to display when running inline mode). Args: size: Size of the terminal Returns: Height for inline mode.

(self, size: Size)

Source from the content-addressed store, hash-verified

1434 self.check_idle()
1435
1436 def _get_inline_height(self, size: Size) -> int:
1437 """Get the inline height (number of lines to display when running inline mode).
1438
1439 Args:
1440 size: Size of the terminal
1441
1442 Returns:
1443 Height for inline mode.
1444 """
1445 height_scalar = self.styles.height
1446 if height_scalar is None or height_scalar.is_auto:
1447 inline_height = self.get_content_height(size, size, size.width)
1448 else:
1449 inline_height = int(height_scalar.resolve(size, size))
1450 inline_height += self.styles.gutter.height
1451 min_height = self.styles.min_height
1452 max_height = self.styles.max_height
1453 if min_height is not None:
1454 inline_height = max(inline_height, int(min_height.resolve(size, size)))
1455 if max_height is not None:
1456 inline_height = min(inline_height, int(max_height.resolve(size, size)))
1457 inline_height = min(self.app.size.height, inline_height)
1458 return inline_height
1459
1460 def _screen_resized(self, size: Size) -> None:
1461 """Called by App when the screen is resized."""

Callers 2

_compositor_refreshMethod · 0.45
_refresh_layoutMethod · 0.45

Calls 2

get_content_heightMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected