44 from textual .app import ComposeResult
55 from textual .containers import Vertical
66 from textual .screen import ModalScreen
7- from textual .widgets import Input , Label , Static
7+ from textual .widgets import Input , Label , Rule , Static
88
99except ImportError : # pragma: no cover
1010 from unittest .mock import MagicMock
1111
1212 ComposeResult = MagicMock ()
1313 Vertical = MagicMock ()
14- Static = Input = Label = MagicMock ()
1514 ModalScreen = MagicMock ()
15+ Input = Label = Rule = Static = MagicMock ()
1616
1717
1818class Help (ModalScreen [str ]): # type: ignore[misc]
@@ -34,7 +34,6 @@ class Help(ModalScreen[str]): # type: ignore[misc]
3434 .title {
3535 text-style: bold;
3636 content-align: center middle;
37- margin-bottom: 1;
3837 }
3938
4039 .section {
@@ -53,6 +52,7 @@ class Help(ModalScreen[str]): # type: ignore[misc]
5352 def compose (self ) -> ComposeResult :
5453 yield Vertical (
5554 Label ("Keyboard Shortcuts" , classes = "title" ),
55+ Rule (line_style = "ascii" ),
5656 * self ._build_help (),
5757 Static ("[dim]Press Esc to close[/]" , classes = "footer" ),
5858 )
@@ -71,6 +71,6 @@ def _build_help() -> list[Static]:
7171 return widgets
7272
7373 def on_key (self , event : Input .Submitted ) -> None :
74- if event .key in ("escape" , "question_mark" ):
74+ if event .key in ("escape" , "q" , " question_mark" ):
7575 event .stop ()
7676 self .dismiss (None )
0 commit comments