Skip to content

Commit

Permalink
Merge pull request #4833 from Textualize/fix-leave
Browse files Browse the repository at this point in the history
fix slow UI
  • Loading branch information
willmcgugan authored Aug 2, 2024
2 parents fcab581 + 319e8aa commit fd36937
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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/).


## [0.75.1] - 2024-08-02

### Fixed

- Fixed issue with Enter events causing unresponsive UI

## [0.75.0] - 2024-08-01

### Added
Expand Down Expand Up @@ -2250,6 +2257,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

[0.75.1]: https://github.com/Textualize/textual/compare/v0.75.0...v0.75.1
[0.75.0]: https://github.com/Textualize/textual/compare/v0.74.0...v0.75.0
[0.74.0]: https://github.com/Textualize/textual/compare/v0.73.0...v0.74.0
[0.73.0]: https://github.com/Textualize/textual/compare/v0.72.0...v0.73.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 = "0.75.0"
version = "0.75.1"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
6 changes: 4 additions & 2 deletions src/textual/scrollbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ def _on_hide(self, event: events.Hide) -> None:
self.grabbed = None

def _on_enter(self, event: events.Enter) -> None:
self.mouse_over = True
if event.node is self:
self.mouse_over = True

def _on_leave(self, event: events.Leave) -> None:
self.mouse_over = False
if event.node is self:
self.mouse_over = False

def action_scroll_down(self) -> None:
"""Scroll vertical scrollbars down, horizontal scrollbars right."""
Expand Down
8 changes: 5 additions & 3 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3848,11 +3848,13 @@ def _on_mount(self, event: events.Mount) -> None:
self.show_horizontal_scrollbar = True

def _on_leave(self, event: events.Leave) -> None:
self.mouse_hover = False
self.hover_style = Style()
if event.node is self:
self.mouse_hover = False
self.hover_style = Style()

def _on_enter(self, event: events.Enter) -> None:
self.mouse_hover = True
if event.node is self:
self.mouse_hover = True

def _on_focus(self, event: events.Focus) -> None:
self.has_focus = True
Expand Down

0 comments on commit fd36937

Please sign in to comment.