mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[FREELDR:UI] Improve drawing of progress bars, reducing flickering.
- Remove excessive UiDrawBackdrop() calls that caused too many unnecessary redraws. - ProgressBar: Clear only the portions that need to be cleared up. This allows to not use DrawBackdrop anymore and the flickering.
This commit is contained in:
parent
9101247366
commit
e2daca3f60
5 changed files with 18 additions and 20 deletions
|
@ -117,7 +117,6 @@ RamDiskLoadVirtualFile(
|
|||
LARGE_INTEGER Position;
|
||||
|
||||
/* Display progress */
|
||||
UiDrawBackdrop();
|
||||
UiDrawProgressBarCenter(1, 100, MsgBuffer);
|
||||
|
||||
/* Try opening the Ramdisk file */
|
||||
|
|
|
@ -490,9 +490,8 @@ LoadReactOSSetup(
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
UiDrawStatusText("Setup is loading...");
|
||||
|
||||
UiDrawBackdrop();
|
||||
UiDrawStatusText("Setup is loading...");
|
||||
UiDrawProgressBarCenter(1, 100, "Loading ReactOS Setup...");
|
||||
|
||||
/* Retrieve the system path */
|
||||
|
@ -738,7 +737,6 @@ LoadReactOSSetup(
|
|||
SetupBlock->Flags = SETUPLDR_TEXT_MODE;
|
||||
|
||||
/* Load the "setupreg.hiv" setup system hive */
|
||||
UiDrawBackdrop();
|
||||
UiDrawProgressBarCenter(15, 100, "Loading setup system hive...");
|
||||
Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE);
|
||||
TRACE("Setup SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
|
||||
|
|
|
@ -382,7 +382,6 @@ WinLdrLoadModule(PCSTR ModuleName,
|
|||
//CHAR ProgressString[256];
|
||||
|
||||
/* Inform user we are loading files */
|
||||
//UiDrawBackdrop();
|
||||
//RtlStringCbPrintfA(ProgressString, sizeof(ProgressString), "Loading %s...", FileName);
|
||||
//UiDrawProgressBarCenter(1, 100, ProgressString);
|
||||
|
||||
|
@ -467,7 +466,6 @@ LoadModule(
|
|||
CHAR ProgressString[256];
|
||||
PVOID BaseAddress = NULL;
|
||||
|
||||
UiDrawBackdrop();
|
||||
RtlStringCbPrintfA(ProgressString, sizeof(ProgressString), "Loading %s...", File);
|
||||
UiDrawProgressBarCenter(Percentage, 100, ProgressString);
|
||||
|
||||
|
@ -918,7 +916,6 @@ LoadAndBootWindows(
|
|||
AllocateAndInitLPB(OperatingSystemVersion, &LoaderBlock);
|
||||
|
||||
/* Load the system hive */
|
||||
UiDrawBackdrop();
|
||||
UiDrawProgressBarCenter(15, 100, "Loading system hive...");
|
||||
Success = WinLdrInitSystemHive(LoaderBlock, BootPath, FALSE);
|
||||
TRACE("SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
|
||||
|
@ -977,7 +974,6 @@ LoadAndBootWindowsCommon(
|
|||
SystemRoot = strstr(BootPath, "\\");
|
||||
|
||||
/* Detect hardware */
|
||||
UiDrawBackdrop();
|
||||
UiDrawProgressBarCenter(20, 100, "Detecting hardware...");
|
||||
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
||||
|
||||
|
@ -994,7 +990,6 @@ LoadAndBootWindowsCommon(
|
|||
}
|
||||
|
||||
/* Load boot drivers */
|
||||
UiDrawBackdrop();
|
||||
UiDrawProgressBarCenter(100, 100, "Loading boot drivers...");
|
||||
Success = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
|
||||
TRACE("Boot drivers loading %s\n", Success ? "successful" : "failed");
|
||||
|
|
|
@ -80,6 +80,15 @@ MiniTuiDrawProgressBar(
|
|||
/* First make sure the progress bar text fits */
|
||||
UiTruncateStringEllipsis(ProgressText, ProgressBarWidth);
|
||||
|
||||
/* Clear the text area */
|
||||
TuiFillArea(Left, Top, Right,
|
||||
#ifdef NTLDR_PROGRESSBAR
|
||||
Bottom - 1,
|
||||
#else // BTMGR_PROGRESSBAR
|
||||
Bottom - 2, // One empty line between text and bar.
|
||||
#endif
|
||||
' ', ATTR(UiTextColor, UiMenuBgColor));
|
||||
|
||||
/* Draw the "Loading..." text */
|
||||
TuiDrawCenteredText(Left, Top, Right,
|
||||
#ifdef NTLDR_PROGRESSBAR
|
||||
|
@ -89,13 +98,15 @@ MiniTuiDrawProgressBar(
|
|||
#endif
|
||||
ProgressText, ATTR(UiTextColor, UiMenuBgColor));
|
||||
|
||||
/* Draw the percent complete */
|
||||
/* Draw the percent complete -- Use the fill character */
|
||||
for (i = 0; i < (Position * ProgressBarWidth) / Range; i++)
|
||||
{
|
||||
/* Use the fill character */
|
||||
TuiDrawText(Left + i, Bottom,
|
||||
"\xDB", ATTR(UiTextColor, UiMenuBgColor));
|
||||
}
|
||||
/* Fill the remaining with blanks */
|
||||
TuiFillArea(Left + i, Bottom, Right, Bottom,
|
||||
' ', ATTR(UiTextColor, UiMenuBgColor));
|
||||
|
||||
#ifndef _M_ARM
|
||||
TuiUpdateDateTime();
|
||||
|
|
|
@ -744,20 +744,15 @@ TuiDrawProgressBar(
|
|||
TuiDrawCenteredText(Left, Top, Right, Bottom - 1,
|
||||
ProgressText, ATTR(UiTextColor, UiMenuBgColor));
|
||||
|
||||
/* Draw the percent complete */
|
||||
/* Draw the percent complete -- Use the fill character */
|
||||
for (i = 0; i < (Position * ProgressBarWidth) / Range; i++)
|
||||
{
|
||||
/* Use the fill character */
|
||||
TuiDrawText(Left + i, Bottom,
|
||||
"\xDB", ATTR(UiTextColor, UiMenuBgColor));
|
||||
}
|
||||
|
||||
/* Draw the shadow */
|
||||
for (; i < ProgressBarWidth; i++)
|
||||
{
|
||||
TuiDrawText(Left + i, Bottom,
|
||||
"\xB2", ATTR(UiTextColor, UiMenuBgColor));
|
||||
}
|
||||
/* Fill the remaining with shadow blanks */
|
||||
TuiFillArea(Left + i, Bottom, Right, Bottom,
|
||||
'\xB2', ATTR(UiTextColor, UiMenuBgColor));
|
||||
|
||||
#ifndef _M_ARM
|
||||
TuiUpdateDateTime();
|
||||
|
|
Loading…
Reference in a new issue