working email headers display
This commit is contained in:
@@ -56,6 +56,7 @@ class EmailViewerApp(App):
|
||||
CSS_PATH = "email_viewer.tcss"
|
||||
folder = reactive("INBOX")
|
||||
markdown: Reactive[str] = reactive("Loading...")
|
||||
header_expanded = False
|
||||
|
||||
def get_system_commands(self, screen: Screen) -> Iterable[SystemCommand]:
|
||||
yield from super().get_system_commands(screen)
|
||||
@@ -75,6 +76,7 @@ class EmailViewerApp(App):
|
||||
Binding("e", "archive", "Archive message"),
|
||||
Binding("o", "open", "Open message", show=False),
|
||||
Binding("q", "quit", "Quit application"),
|
||||
Binding("h", "toggle_header", "Toggle Envelope Header"),
|
||||
Binding("t", "create_task", "Create Task")
|
||||
]
|
||||
|
||||
@@ -162,6 +164,13 @@ class EmailViewerApp(App):
|
||||
"""Display a status message using the built-in notify function."""
|
||||
self.notify(message, title="Status", severity=severity, timeout=1, markup=True)
|
||||
|
||||
def action_toggle_header(self) -> None:
|
||||
"""Toggle the visibility of the EnvelopeHeader panel."""
|
||||
header = self.query_one(EnvelopeHeader)
|
||||
header.styles.height = "1" if self.header_expanded else "auto"
|
||||
self.header_expanded = not self.header_expanded
|
||||
|
||||
|
||||
def action_next(self) -> None:
|
||||
action_next(self)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user