Archived
1
1
Fork 0

tui: send a notification on color scheme change

This commit is contained in:
Josh Lay 2023-07-23 02:11:32 -05:00
parent 9622c3270b
commit d1de35beb9
Signed by: jlay
GPG key ID: B265E45CACAD108A

View file

@ -250,7 +250,10 @@ class app(App): # pylint: disable=invalid-name
Wraps 'action_toggle_dark' with our logging"""
self.app.dark = not self.app.dark
self.update_log(f"[bold]Dark side: [italic]{self.app.dark}")
# inline conditional due to how Textual doesn't pretty notifs. for us like TextLog
message = f"[bold]Dark side: [italic][{'green' if self.app.dark else 'red'}]{self.app.dark}"
self.notify(message)
self.update_log(message)
async def action_custom_logscroll(self, direction: str) -> None:
"""Action that handles scrolling of the logging widget