Skip to content

Commit

Permalink
Add docstrings to properties.
Browse files Browse the repository at this point in the history
Related comment: #3199 (comment)
  • Loading branch information
rodrigogiraoserrao committed Sep 11, 2023
1 parent 53125ec commit 5a15e9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/textual/widgets/_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,20 @@ def _on_click(self):

@property
def screen_title(self) -> str:
"""The title that this header will display.
This depends on [`Screen.title`][textual.screen.Screen.title] and [`App.title`][textual.app.App.title].
"""
screen_title = self.screen.title
title = screen_title if screen_title is not None else self.app.title
return title

@property
def screen_sub_title(self) -> str:
"""The sub-title that this header will display.
This depends on [`Screen.sub_title`][textual.screen.Screen.sub_title] and [`App.sub_title`][textual.app.App.sub_title].
"""
screen_sub_title = self.screen.sub_title
sub_title = (
screen_sub_title if screen_sub_title is not None else self.app.sub_title
Expand Down

0 comments on commit 5a15e9c

Please sign in to comment.