Skip to content

Commit

Permalink
grid height
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 12, 2024
1 parent f670fbe commit e366556
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

- Grid will now size children to the maximum height of a row

## [0.83.0] - 2024-10-10

### Added
Expand Down
1 change: 0 additions & 1 deletion src/textual/css/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"focus-within",
"focus",
"hover",
"hover-within",
"inline",
"light",
"nocolor",
Expand Down
2 changes: 2 additions & 0 deletions src/textual/layouts/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ def apply_height_limits(widget: Widget, height: int) -> int:
Fraction(cell_size.width),
Fraction(cell_size.height),
)
if column_span == 1 and row_span == 1:
height = cell_height
region = (
Region(x, y, int(width + margin.width), int(height + margin.height))
.crop_size(cell_size)
Expand Down
5 changes: 0 additions & 5 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ class Widget(DOMNode):
mouse_hover: Reactive[bool] = Reactive(False, repaint=False)
"""Is the mouse over this widget? Read only."""

mouse_hover_within: Reactive[bool] = Reactive(False, repaint=False)
"""Is the mouse over this widget or a descendant? Read only."""

scroll_x: Reactive[float] = Reactive(0.0, repaint=False, layout=False)
"""The scroll position on the X axis."""

Expand Down Expand Up @@ -3270,8 +3267,6 @@ def get_pseudo_classes(self) -> Iterable[str]:
app = self.app
if self.mouse_hover:
yield "hover"
if self.mouse_hover_within:
yield "hover-within"
if self.has_focus:
yield "focus"
else:
Expand Down

0 comments on commit e366556

Please sign in to comment.