summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-25 05:32:17 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-25 05:32:17 +0000
commit1a788cdd654967ca2a7409375ae91790759ed934 (patch)
tree822ded32f617ddbeaec0f22504e0fdfd0052a6c4
parent850f13ebb26b50b0f484dd354c0c826033241a08 (diff)
downloadedk2-platforms-1a788cdd654967ca2a7409375ae91790759ed934.tar.xz
Fix the following three issues:
1. When question is grayout, its value is not gray. 2. When type Ui UP action, Repaint is not trigged when next MenuOption is above the TopOfScreen. 3. When type Ui Down action, TopOfScreen is not calculated correctly when screen roll is required. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10977 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c60
1 files changed, 17 insertions, 43 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index 3310bb284e..3448df8d19 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -1833,7 +1833,6 @@ UiDisplayMenu (
Temp = 0;
Row = OriginalRow;
- gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);
Status = ProcessOptions (Selection, MenuOption, FALSE, &OptionString);
if (EFI_ERROR (Status)) {
//
@@ -1981,6 +1980,7 @@ UiDisplayMenu (
Row = OriginalRow;
FreePool (StringPtr);
}
+ gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);
//
// Need to handle the bottom of the display
@@ -2813,6 +2813,7 @@ UiDisplayMenu (
NewPos = NewPos->BackLink;
}
+ Difference = MoveToNextStatement (TRUE, &NewPos);
PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);
DistanceValue = PreviousMenuOption->Skip;
@@ -2824,31 +2825,6 @@ UiDisplayMenu (
//
DistanceValue += AdjustDateAndTimePosition (TRUE, &NewPos);
- //
- // Check the previous menu entry to see if it was a zero-length advance. If it was,
- // don't worry about a redraw.
- //
- ASSERT(MenuOption != NULL);
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {
- Repaint = TRUE;
- TopOfScreen = NewPos;
- }
-
- Difference = MoveToNextStatement (TRUE, &NewPos);
- PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);
- DistanceValue += PreviousMenuOption->Skip;
-
- if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {
- if (Difference > 0) {
- //
- // Previous focus MenuOption is above the TopOfScreen, so we need to scroll
- //
- TopOfScreen = NewPos;
- Repaint = TRUE;
- SkipValue = 0;
- OldSkipValue = 0;
- }
- }
if (Difference < 0) {
//
// We want to goto previous MenuOption, but finally we go down.
@@ -2859,6 +2835,14 @@ UiDisplayMenu (
TopOfScreen = gMenuOption.ForwardLink;
Repaint = TRUE;
}
+ } else if ((INTN) MenuOption->Row - (INTN) DistanceValue - Difference < (INTN) TopRow) {
+ //
+ // Previous focus MenuOption is above the TopOfScreen, so we need to scroll
+ //
+ TopOfScreen = NewPos;
+ Repaint = TRUE;
+ SkipValue = 0;
+ OldSkipValue = 0;
}
//
@@ -3002,14 +2986,15 @@ UiDisplayMenu (
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
NewLine = TRUE;
NewPos = NewPos->ForwardLink;
- NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);
- DistanceValue += NextMenuOption->Skip;
DistanceValue += MoveToNextStatement (FALSE, &NewPos);
+ NextMenuOption = MENU_OPTION_FROM_LINK (NewPos);
+
//
// An option might be multi-line, so we need to reflect that data in the overall skip value
//
UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, (UINTN) SkipValue);
+ DistanceValue += NextMenuOption->Skip;
Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;
if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&
@@ -3051,26 +3036,13 @@ UiDisplayMenu (
//
// If we have a remainder, skip that many more op-codes until we drain the remainder
//
- for (;
- Difference >= (INTN) SavedMenuOption->Skip;
- Difference = Difference - (INTN) SavedMenuOption->Skip
- ) {
+ while (Difference >= (INTN) SavedMenuOption->Skip) {
//
// Since the Difference is greater than or equal to this op-code's skip value, skip it
//
+ Difference = Difference - (INTN) SavedMenuOption->Skip;
TopOfScreen = TopOfScreen->ForwardLink;
SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);
- if (Difference < (INTN) SavedMenuOption->Skip) {
- Difference = SavedMenuOption->Skip - Difference - 1;
- break;
- } else {
- if (Difference == (INTN) SavedMenuOption->Skip) {
- TopOfScreen = TopOfScreen->ForwardLink;
- SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);
- Difference = SavedMenuOption->Skip - Difference;
- break;
- }
- }
}
//
// Since we will act on this op-code in the next routine, and increment the
@@ -3103,6 +3075,8 @@ UiDisplayMenu (
} else {
SkipValue++;
}
+ } else if (SavedMenuOption->Skip == 1) {
+ SkipValue = 0;
} else {
SkipValue = 0;
TopOfScreen = TopOfScreen->ForwardLink;