From ab473ab6f979bddc92c583c2e67e62c78e047136 Mon Sep 17 00:00:00 2001 From: Aptivi Date: Wed, 28 Feb 2024 13:37:09 +0300 Subject: [PATCH] imp - Let Terminaux manage stopwatch clearing --- Terminaux attempts to clear the screen on resize, so we need to use this feature instead of re-implementing it. --- Type: imp Breaking: False Doc Required: False Part: 1/1 --- .../Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs index 73bb1dc826..4d6fff24b9 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs @@ -56,7 +56,6 @@ public static void OpenStopwatch() ScreenTools.SetCurrent(watchScreen); ColorTools.LoadBack(); string status = Translate.DoTranslation("Stopwatch is ready."); - bool resetting = false; // Set the random lap color int RedValue = RandomDriver.Random(255); @@ -68,11 +67,6 @@ public static void OpenStopwatch() watchScreenPart.AddDynamicText(() => { // If resized, clear the console - if (resetting || ConsoleResizeHandler.WasResized()) - { - resetting = false; - ColorTools.LoadBack(); - } ConsoleWrapper.CursorVisible = false; var builder = new StringBuilder(); @@ -192,7 +186,7 @@ public static void OpenStopwatch() if (Stopwatch.IsRunning) Stopwatch.Reset(); running = false; - resetting = true; + watchScreen.RequireRefresh(); // Clear the laps Laps.Clear();