From fa8ddd5667e1cb8c60a7f7511379822fdbdcea92 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 24 May 2024 16:24:04 +0100 Subject: [PATCH 1/3] refresh bindings on auto focus --- src/textual/app.py | 2 +- src/textual/screen.py | 1 + src/textual/widgets/_footer.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/textual/app.py b/src/textual/app.py index 58cdaad074..a0b914a9ea 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -80,7 +80,7 @@ from ._worker_manager import WorkerManager from .actions import ActionParseResult, SkipAction from .await_remove import AwaitRemove -from .binding import Binding, BindingType +from .binding import Binding, BindingType, _Bindings from .command import CommandPalette, Provider from .css.errors import StylesheetError from .css.query import NoMatches diff --git a/src/textual/screen.py b/src/textual/screen.py index 2af0f4968e..b8de2a2b89 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -721,6 +721,7 @@ def scroll_to_center(widget: Widget) -> None: self.log.debug(widget, "was focused") self._update_focus_styles(focused, blurred) + self.call_after_refresh(self.refresh_bindings) def _extend_compose(self, widgets: list[Widget]) -> None: """Insert Textual's own internal widgets. diff --git a/src/textual/widgets/_footer.py b/src/textual/widgets/_footer.py index f1a5d1f281..214fba314c 100644 --- a/src/textual/widgets/_footer.py +++ b/src/textual/widgets/_footer.py @@ -81,7 +81,7 @@ def render(self) -> Text: key_display = self.key_display if self.upper_case_keys: key_display = key_display.upper() - if key_display.lower().startswith("ctrl+"): + if self.ctrl_to_caret and key_display.lower().startswith("ctrl+"): key_display = "^" + key_display.split("+", 1)[1] description = self.description if self.compact: From e04754ac472d76aa7ff236b5c3d809213b6f4eaa Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 24 May 2024 16:24:39 +0100 Subject: [PATCH 2/3] bump --- CHANGELOG.md | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be8288bb1e..2d542aff38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +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 +## [0.63.3] - 2024-05-24 ### Fixed - Fixed `Footer` grid size https://github.com/Textualize/textual/pull/4545 +- Fixed bindings not updated on auto focus ### Changed @@ -2012,6 +2013,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.63.3]: https://github.com/Textualize/textual/compare/v0.63.2...v0.63.3 [0.63.2]: https://github.com/Textualize/textual/compare/v0.63.1...v0.63.2 [0.63.1]: https://github.com/Textualize/textual/compare/v0.63.0...v0.63.1 [0.63.0]: https://github.com/Textualize/textual/compare/v0.62.0...v0.63.0 diff --git a/pyproject.toml b/pyproject.toml index 2b413e25d2..f4f7302d1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "textual" -version = "0.63.2" +version = "0.63.3" homepage = "https://github.com/Textualize/textual" repository = "https://github.com/Textualize/textual" documentation = "https://textual.textualize.io/" From cbf385e43b6ffd78bfbde95ef19e35367d9eed77 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 24 May 2024 16:33:00 +0100 Subject: [PATCH 3/3] changelog [skipci] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d542aff38..9e8a00e1fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed `Footer` grid size https://github.com/Textualize/textual/pull/4545 -- Fixed bindings not updated on auto focus +- Fixed bindings not updated on auto focus https://github.com/Textualize/textual/pull/4551 ### Changed