https://git.reactos.org/?p=reactos.git;a=commitdiff;h=914769a14ab6b7810e0984eb974e21d724226493

commit 914769a14ab6b7810e0984eb974e21d724226493
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Aug 26 16:41:43 2018 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Aug 26 20:41:49 2018 +0200

    [USETUP] DrawProgressBar(): Draw the progress bar borders first, then draw 
its contents.
---
 base/setup/usetup/progress.c | 39 +++++++++++++++++----------------------
 1 file changed, 17 insertions(+), 22 deletions(-)

diff --git a/base/setup/usetup/progress.c b/base/setup/usetup/progress.c
index 71f9ae99df..48e202ecbf 100644
--- a/base/setup/usetup/progress.c
+++ b/base/setup/usetup/progress.c
@@ -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,

Reply via email to