-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
After I set ENABLE_COMMAND_PALETTE = False, I founded that the icon in header is still showing the tooltip about palette.
Maybe we can do something like the following code make the icon of header configurable.
from textual.widgets import Header
from textual.widgets._header import HeaderTitle, HeaderClock, HeaderClockSpace, HeaderIcon
class HeaderWithIcon(Header):
def __init__(self, show_clock: bool = False, show_icon: bool = True, *, name: str | None = None, id: str | None = None, classes: str | None = None, icon: str | None = None, time_format: str | None = None):
super().__init__(show_clock, name=name, id=id, classes=classes, icon=icon, time_format=time_format)
self._show_icon = show_icon
self.header_icon = HeaderIcon()
self.header_icon.visible = self._show_icon
def compose(self):
self.header_icon.data_bind(Header.icon)
yield self.header_icon
yield HeaderTitle()
yield (
HeaderClock().data_bind(Header.time_format)
if self._show_clock
else HeaderClockSpace()
)
Header = HeaderWithIconBy the hack way, I can change the visible and the tooltip of the icon:
h = Header()
h.header_icon.tooltip = 'No palette'TomJGooding, TheBruh141 and MorningLightMountain713
Metadata
Metadata
Assignees
Labels
No labels