Skip to content

Commit a729ee6

Browse files
committed
docstring and private
1 parent 02452c3 commit a729ee6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/textual/app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,10 @@ def namespace_bindings(self) -> dict[str, tuple[DOMNode, Binding]]:
601601
602602
This property may be used to inspect current bindings.
603603
604+
Returns:
605+
606+
A mapping of keys on to node + binding.
607+
604608
"""
605609

606610
namespace_binding_map: dict[str, tuple[DOMNode, Binding]] = {}
@@ -625,6 +629,8 @@ def compose(self) -> ComposeResult:
625629
def get_css_variables(self) -> dict[str, str]:
626630
"""Get a mapping of variables used to pre-populate CSS.
627631
632+
May be implemented in a subclass to add new CSS variables.
633+
628634
Returns:
629635
A mapping of variable name to value.
630636
"""

src/textual/widgets/_footer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,32 +60,32 @@ def __init__(self) -> None:
6060
self._key_text: Text | None = None
6161
self.auto_links = False
6262

63-
async def watch_highlight_key(self, value) -> None:
63+
async def watch_highlight_key(self, value: str | None) -> None:
6464
"""If highlight key changes we need to regenerate the text."""
6565
self._key_text = None
6666
self.refresh()
6767

68-
def on_mount(self) -> None:
68+
def _on_mount(self) -> None:
6969
self.watch(self.screen, "focused", self._bindings_changed)
7070
self.watch(self.screen, "stack_updates", self._bindings_changed)
7171

7272
def _bindings_changed(self, focused: Widget | None) -> None:
7373
self._key_text = None
7474
self.refresh()
7575

76-
async def on_mouse_move(self, event: events.MouseMove) -> None:
76+
def _on_mouse_move(self, event: events.MouseMove) -> None:
7777
"""Store any key we are moving over."""
7878
self.highlight_key = event.style.meta.get("key")
7979

80-
async def on_leave(self, event: events.Leave) -> None:
80+
def _on_leave(self, event: events.Leave) -> None:
8181
"""Clear any highlight when the mouse leaves the widget"""
8282
if self.screen.is_current:
8383
self.highlight_key = None
8484

8585
def __rich_repr__(self) -> rich.repr.Result:
8686
yield from super().__rich_repr__()
8787

88-
def make_key_text(self) -> Text:
88+
def _make_key_text(self) -> Text:
8989
"""Create text containing all the keys."""
9090
base_style = self.rich_style
9191
text = Text(
@@ -140,5 +140,5 @@ def post_render(self, renderable):
140140

141141
def render(self) -> RenderableType:
142142
if self._key_text is None:
143-
self._key_text = self.make_key_text()
143+
self._key_text = self._make_key_text()
144144
return self._key_text

src/textual/widgets/_header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class Header(Widget):
126126

127127
DEFAULT_CLASSES = ""
128128

129-
tall = Reactive(False)
130-
"""Track if the `Header` is in a tall state or not."""
129+
tall: Reactive[bool] = Reactive(False)
130+
"""Set to `True` for a taller header or `False` for a single line header."""
131131

132132
def __init__(
133133
self,

0 commit comments

Comments
 (0)