Do not print caption, nor message on the dialog box if not needed
This commit is contained in:
parent
ceee294df7
commit
c2d40e3011
@ -341,16 +341,13 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
||||
Handle->DialogColor = EFI_TEXT_BGCOLOR_RED;
|
||||
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
|
||||
}
|
||||
else
|
||||
else if(Handle->Attributes & XTBL_TUI_DIALOG_GENERIC_BOX)
|
||||
{
|
||||
/* Generic dialog with blue background and cyan button */
|
||||
Handle->DialogColor = EFI_TEXT_BGCOLOR_BLUE;
|
||||
Handle->TextColor = EFI_TEXT_FGCOLOR_WHITE;
|
||||
}
|
||||
|
||||
/* Get caption length */
|
||||
CaptionLength = RtlWideStringLength(Caption, 0);
|
||||
|
||||
/* Set dialog box colors */
|
||||
BlSetConsoleAttributes(Handle->DialogColor | 0x0F);
|
||||
|
||||
@ -365,6 +362,14 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
||||
{
|
||||
/* Draw top line of the dialog box, starting from the left corner */
|
||||
BoxLine[0] = EFI_TEXT_BOX_DOWN_RIGHT;
|
||||
|
||||
/* Check if there is a caption for this dialog */
|
||||
if(Caption != NULL)
|
||||
{
|
||||
/* Get caption length */
|
||||
CaptionLength = RtlWideStringLength(Caption, 0);
|
||||
|
||||
/* Start caption area with vertical line */
|
||||
BoxLine[1] = EFI_TEXT_BOX_VERTICAL_LEFT;
|
||||
|
||||
/* Fill caption area with spaces */
|
||||
@ -375,6 +380,12 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
||||
|
||||
/* End caption area with vertical line */
|
||||
BoxLine[CaptionLength + 4] = EFI_TEXT_BOX_VERTICAL_RIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No caption, -4 because of left and right vertical lines and corresponding spaces */
|
||||
CaptionLength = -4;
|
||||
}
|
||||
|
||||
/* Draw bottom line */
|
||||
for(PosX = CaptionLength + 5; PosX < Handle->Width - 1; PosX++)
|
||||
@ -421,12 +432,20 @@ BlpDrawDialogBox(IN OUT PXTBL_DIALOG_HANDLE Handle,
|
||||
BlConsoleWrite(BoxLine);
|
||||
}
|
||||
|
||||
/* Make sure there is a caption to print */
|
||||
if(Caption != NULL)
|
||||
{
|
||||
/* Write dialog box caption */
|
||||
BlSetCursorPosition(Handle->PosX + 3, Handle->PosY);
|
||||
BlConsolePrint(L"%S", Caption);
|
||||
}
|
||||
|
||||
/* Make sure there is a message to print */
|
||||
if(Message != NULL)
|
||||
{
|
||||
/* Write a message on the dialog box */
|
||||
BlpDrawDialogMessage(Handle, Message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user