From 5161cbc6ff49ce92e225ba71ad7372cd0adff86b Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Mon, 23 Dec 2024 18:31:41 +0000 Subject: [PATCH 1/2] fix(header): show command palette tooltip only when enabled --- src/textual/widgets/_header.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/textual/widgets/_header.py b/src/textual/widgets/_header.py index 2482a578e4..a760aa81d1 100644 --- a/src/textual/widgets/_header.py +++ b/src/textual/widgets/_header.py @@ -33,7 +33,10 @@ class HeaderIcon(Widget): """The character to use as the icon within the header.""" def on_mount(self) -> None: - self.tooltip = "Open the command palette" + if self.app.ENABLE_COMMAND_PALETTE: + self.tooltip = "Open the command palette" + else: + self.disabled = True async def on_click(self, event: Click) -> None: """Launch the command palette when icon is clicked.""" From ddd703bd1ba40e5e1f56df9b9de1e3c78d3ad9ba Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:38:28 +0000 Subject: [PATCH 2/2] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1df37fbc..115ab1d36e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed `Pilot.click` not working with `times` parameter https://github.com/Textualize/textual/pull/5398 - Fixed select refocusing itself too late https://github.com/Textualize/textual/pull/5420 +- Fixed `Header` icon showing command palette tooltip when disabled https://github.com/Textualize/textual/pull/5427 ### Added