From d1de35beb9c3901d7b01f843e43d28b827813e4f Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Sun, 23 Jul 2023 02:11:32 -0500 Subject: [PATCH] tui: send a notification on color scheme change --- src/amdgpu_stats/tui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amdgpu_stats/tui.py b/src/amdgpu_stats/tui.py index fc7ef13..c7e3427 100644 --- a/src/amdgpu_stats/tui.py +++ b/src/amdgpu_stats/tui.py @@ -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