summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-10 02:28:15 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-10 02:28:15 +0000
commit487ef018038fa782571bfa5f07a9362e86d1c17b (patch)
tree288156013f675179eecf44eea590f509acb7e11a /MdeModulePkg/Universal
parentd12c6a54856a00474c77576cc7ffc167839145ca (diff)
downloadedk2-platforms-487ef018038fa782571bfa5f07a9362e86d1c17b.tar.xz
1. The old refresh string code also update the time/date opcode. But for the reason that time/date opcode updates the string with the same size, so skip the refresh code for it.
2. Also, the clean old string action used save attribute with paint string action which makes the background show abnormal. Now using the normal attribute to clean the old string. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11359 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index 05fcb7cc5d..3ab63be2d6 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -342,7 +342,6 @@ RefreshForm (
FORM_BROWSER_STATEMENT *Question;
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
EFI_BROWSER_ACTION_REQUEST ActionRequest;
- CHAR16 *PadString;
if (gMenuRefreshHead != NULL) {
@@ -354,8 +353,6 @@ RefreshForm (
mHiiPackageListUpdated = FALSE;
do {
- gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);
-
Selection = MenuRefreshEntry->Selection;
Question = MenuRefreshEntry->MenuOption->ThisTag;
@@ -374,11 +371,22 @@ RefreshForm (
for (Index = 0; OptionString[Index] == L' '; Index++)
;
- PadString = AllocatePool (gOptionBlockWidth * sizeof (CHAR16));
- SetMem16 (PadString, (gOptionBlockWidth - 1) * sizeof (CHAR16), CHAR_SPACE);
- PadString[gOptionBlockWidth - 1] = 0;
- PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, PadString);
- FreePool (PadString);
+ //
+ // If old Text is longer than new string, need to clean the old string before paint the newer.
+ // This option is no need for time/date opcode, because time/data opcode has fixed string length.
+ //
+ if ((MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_DATE_OP) &&
+ (MenuRefreshEntry->MenuOption->ThisTag->Operand != EFI_IFR_TIME_OP)) {
+ ClearLines (
+ MenuRefreshEntry->CurrentColumn,
+ MenuRefreshEntry->CurrentColumn + gOptionBlockWidth - 1,
+ MenuRefreshEntry->CurrentRow,
+ MenuRefreshEntry->CurrentRow,
+ PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND
+ );
+ }
+
+ gST->ConOut->SetAttribute (gST->ConOut, MenuRefreshEntry->CurrentAttribute);
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);
FreePool (OptionString);
}