Skip to content

Commit

Permalink
imp - Let Terminaux manage stopwatch clearing
Browse files Browse the repository at this point in the history
---

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
  • Loading branch information
AptiviCEO committed Feb 28, 2024
1 parent 229d25a commit ab473ab
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -192,7 +186,7 @@ public static void OpenStopwatch()
if (Stopwatch.IsRunning)
Stopwatch.Reset();
running = false;
resetting = true;
watchScreen.RequireRefresh();

// Clear the laps
Laps.Clear();
Expand Down

0 comments on commit ab473ab

Please sign in to comment.