-
-
Notifications
You must be signed in to change notification settings - Fork 975
Open
Description
It seems that the title within a Header
is always off by one character, in respect to being central in the display, when compared to another widget that shows the same text centred:
from textual.app import App, ComposeResult, RenderResult
from textual.containers import Horizontal
from textual.widgets import Header
class MiddleOfDisplay(Horizontal):
DEFAULT_CSS = """
MiddleOfDisplay {
content-align: center middle;
height: 1;
}
"""
def render(self) -> RenderResult:
return "Title - Title"
class HeaderCheckApp(App[None]):
TITLE = "Title"
SUB_TITLE = "Title"
def compose(self) -> ComposeResult:
yield Header()
yield MiddleOfDisplay()
if __name__ == "__main__":
HeaderCheckApp().run()

I suspect this has long been the case; I did a quick check of an assortment of Textual versions going back to 1.0.0 and the result is always the same.
Metadata
Metadata
Assignees
Labels
No labels