Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(header): show command palette tooltip only when enabled #5427

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/textual/widgets/_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
Loading