Fix progress bar colors
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 26s
Builds / ExectOS (i686) (push) Successful in 25s

This commit is contained in:
Rafal Kupiec 2023-12-16 10:12:23 +01:00
parent e3a4460dbc
commit c649087c3e
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -23,6 +23,8 @@
typedef struct _XTBL_DIALOG_HANDLE
{
UCHAR Attributes;
UCHAR DialogColor;
UCHAR TextColor;
UINT_PTR ResX;
UINT_PTR ResY;
UINT_PTR PosX;
@ -147,25 +149,26 @@ BlpDrawDialogBox(IN PXTBL_DIALOG_HANDLE Handle,
PWCHAR MsgLine, LastMsgLine;
UINT_PTR Line, PosX, PosY;
SIZE_T CaptionLength;
UCHAR DialogColor;
/* Set dialog colors */
if(Handle->Attributes & TUI_DIALOG_ERROR_BOX)
{
/* Error dialog with red background and brown button */
DialogColor = EFI_TEXT_BGCOLOR_RED;
Handle->DialogColor = EFI_TEXT_BGCOLOR_RED;
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
}
else
{
/* Generic dialog with blue background and cyan button */
DialogColor = EFI_TEXT_BGCOLOR_BLUE;
Handle->DialogColor = EFI_TEXT_BGCOLOR_BLUE;
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
}
/* Get caption length */
CaptionLength = RtlWideStringLength(Caption, 0);
/* Set dialog box colors */
BlSetConsoleAttributes(DialogColor | 0x0F);
BlSetConsoleAttributes(Handle->DialogColor | 0x0F);
/* Iterate through dialog box lines */
for(PosY = Handle->PosY; PosY < Handle->PosY + Handle->Height; PosY++)
@ -688,6 +691,7 @@ BlUpdateProgressBar(IN PXTBL_DIALOG_HANDLE Handle,
/* Update message in the dialog box */
BlSetCursorPosition(Handle->PosX + 2, Handle->PosY + 2);
BlSetConsoleAttributes(Handle->DialogColor | Handle->TextColor);
BlConsolePrint(L"%S", Message);
if(Length < Handle->Width - 4)