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 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."""