[USETUP] DrawProgressBar(): Draw the progress bar borders first, then draw its contents.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 26 Aug 2018 14:41:43 +0000 (16:41 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 26 Aug 2018 18:41:49 +0000 (20:41 +0200)
base/setup/usetup/progress.c

index 71f9ae9..48e202e 100644 (file)
@@ -8,7 +8,6 @@
 
 /* FUNCTIONS ****************************************************************/
 
-
 static
 VOID
 DrawBorder(
@@ -92,7 +91,6 @@ DrawBorder(
                                 &Written);
 }
 
-
 static
 VOID
 DrawThickBorder(
@@ -176,7 +174,6 @@ DrawThickBorder(
                                 &Written);
 }
 
-
 static
 VOID
 DrawProgressBar(
@@ -187,6 +184,22 @@ DrawProgressBar(
     DWORD Written;
     PROGRESSBAR BarBorder = *Bar;
 
+    /* Draw the progress bar "border" border */
+    if (Bar->Double)
+    {
+        BarBorder.Top -= 5;
+        BarBorder.Bottom += 2;
+        BarBorder.Right += 5;
+        BarBorder.Left -= 5;
+        DrawThickBorder(&BarBorder);
+    }
+
+    /* Draw the progress bar border */
+    DrawBorder(Bar);
+
+    /* Write the text associated with the bar */
+    CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text);
+
     /* Print percentage */
     sprintf(TextBuffer, "%-3lu%%", Bar->Percent);
 
@@ -198,23 +211,7 @@ DrawProgressBar(
                                  coPos,
                                  &Written);
 
-    /* Draw the progress bar border */
-    DrawBorder(Bar);
-
-    /* Write Text Associated with Bar */
-    CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text);
-
-    /* Draw the progress bar "border" border */
-    if (Bar->Double)
-    {
-        BarBorder.Top -= 5;
-        BarBorder.Bottom += 2;
-        BarBorder.Right += 5;
-        BarBorder.Left -= 5;
-        DrawThickBorder(&BarBorder);
-    }
-
-    /* Draw the bar */
+    /* Draw the empty bar */
     coPos.X = Bar->Left + 1;
     for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
     {
@@ -315,7 +312,6 @@ ProgressSetStepCount(
     DrawProgressBar(Bar);
 }
 
-
 VOID
 ProgressNextStep(
     PPROGRESSBAR Bar)
@@ -323,7 +319,6 @@ ProgressNextStep(
     ProgressSetStep(Bar, Bar->CurrentStep + 1);
 }
 
-
 VOID
 ProgressSetStep(
     PPROGRESSBAR Bar,