diff --git a/xtldr2/textui.c b/xtldr2/textui.c index 4aa61b6..1cc3fe2 100644 --- a/xtldr2/textui.c +++ b/xtldr2/textui.c @@ -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)