Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ 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/).

## [7.0.1] - 2026-01-07

### Added

- Added a `refresh_styles` boolean to the `ScreenResult` message which reduces style updates when popping screens

## [7.0.0] - 2026-01-03

### Changed

- `Node.update_node_styles` has grown a `animate` parameter

### Added

- Added atom-one-dark and atom-one-light themes @NSPC911 https://github.com/Textualize/textual/pull/6301

## [6.12.0] - 2026-01-02

### Fixed
Expand Down Expand Up @@ -3268,6 +3278,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
- New handler system for messages that doesn't require inheritance
- Improved traceback handling

[7.0.1]: https://github.com/Textualize/textual/compare/v7.0.0...v7.0.1
[7.0.0]: https://github.com/Textualize/textual/compare/v6.11.0...v7.0.0
[6.11.0]: https://github.com/Textualize/textual/compare/v6.10.0...v6.11.0
[6.10.0]: https://github.com/Textualize/textual/compare/v6.9.0...v6.10.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "7.0.0"
version = "7.0.1"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
9 changes: 6 additions & 3 deletions src/textual/_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,16 @@ def resolve_box_models(
)

remaining_space = int(max(0, size.height - total_remaining - margin_height))

fraction_unit = resolve_fraction_unit(
[
styles
for styles in widget_styles
if styles.height is not None
and styles.height.is_fraction
and styles.overlay != "screen"
if (
styles.height is not None
and styles.height.is_fraction
and styles.overlay != "screen"
)
],
size,
viewport_size,
Expand Down
4 changes: 3 additions & 1 deletion src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2979,7 +2979,9 @@ def pop_screen(self) -> AwaitComplete:

previous_screen = screen_stack.pop()
previous_screen._pop_result_callback()
self.screen.post_message(events.ScreenResume())
self.screen.post_message(
events.ScreenResume(refresh_styles=previous_screen.styles.background.a < 0)
)
self.log.system(f"{self.screen} is active")

async def do_pop() -> None:
Expand Down
7 changes: 7 additions & 0 deletions src/textual/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,13 +901,20 @@ def __rich_repr__(self) -> rich.repr.Result:
yield "text", self.text


@dataclass
class ScreenResume(Event, bubble=False):
"""Sent to screen that has been made active.

- [ ] Bubbles
- [ ] Verbose
"""

refresh_styles: bool = True
"""Should the resuming screen refresh its styles?"""

def __rich_repr__(self) -> rich.repr.Result:
yield self.refresh_styles


class ScreenSuspend(Event, bubble=False):
"""Sent to screen when it is no longer active.
Expand Down
8 changes: 5 additions & 3 deletions src/textual/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ def _screen_resized(self, size: Size) -> None:
if self.stack_updates and self.is_attached:
self._refresh_layout(size)

def _on_screen_resume(self) -> None:
def _on_screen_resume(self, event: events.ScreenResume) -> None:
"""Screen has resumed."""
if self.app.SUSPENDED_SCREEN_CLASS:
self.remove_class(self.app.SUSPENDED_SCREEN_CLASS)
Expand All @@ -1441,8 +1441,10 @@ def _on_screen_resume(self) -> None:

if self.is_attached:
self._compositor_refresh()
self.update_node_styles(animate=False)
self._refresh_layout(size)
if event.refresh_styles:
self.update_node_styles(animate=False)
if self._size != size:
self._refresh_layout(size)
self.refresh()

async def _compose(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions src/textual/widgets/_collapsible.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class CollapsibleTitle(Static, can_focus=True):
DEFAULT_CSS = """
CollapsibleTitle {
width: auto;
height: auto;
padding: 0 1;
height: auto;
padding: 0 1;
text-style: $block-cursor-blurred-text-style;
color: $block-cursor-blurred-foreground;

Expand Down Expand Up @@ -160,7 +160,7 @@ class Contents(Container):
Contents {
width: 100%;
height: auto;
padding: 1 0 0 3;
padding: 1 0 0 3;
}
"""

Expand Down
Loading