diff options
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Ui.c | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c index ca2ec3b169..01909e4649 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c @@ -2575,7 +2575,18 @@ UiDisplayMenu ( SavedMenuOption = MENU_OPTION_FROM_LINK (Link);
}
- if (Link != NewPos || Index > BottomRow || (Link == NewPos && SavedMenuOption->Row + SavedMenuOption->Skip - 1 > BottomRow)) {
+ //
+ // Not find the selected menu in current show page.
+ // Have two case to enter this if:
+ // 1. Not find the menu at current page.
+ // 2. Find the menu in current page, but the menu shows at the bottom and not all info shows.
+ // For case 2, has an exception: The menu can show more than one pages and now only this menu shows.
+ //
+ // Base on the selected menu will show at the bottom of the page,
+ // select the menu which will show at the top of the page.
+ //
+ if (Link != NewPos || Index > BottomRow ||
+ (Link == NewPos && (SavedMenuOption->Row + SavedMenuOption->Skip - 1 > BottomRow) && (Link != TopOfScreen))) {
//
// Find the MenuOption which has the skip value for Date/Time opcode.
//
@@ -2590,7 +2601,11 @@ UiDisplayMenu ( if (SavedMenuOption->Row == 0) {
UpdateOptionSkipLines (Selection, SavedMenuOption);
}
-
+
+ //
+ // Base on the selected menu will show at the bottome of next page,
+ // select the menu show at the top of the next page.
+ //
Link = NewPos;
for (Index = TopRow + SavedMenuOption->Skip; Index <= BottomRow + 1; ) {
Link = Link->BackLink;
@@ -2598,16 +2613,31 @@ UiDisplayMenu ( if (SavedMenuOption->Row == 0) {
UpdateOptionSkipLines (Selection, SavedMenuOption);
}
- Index += SavedMenuOption->Skip;
+ Index += SavedMenuOption->Skip;
}
-
- SkipValue = Index - BottomRow - 1;
- if (SkipValue > 0 && SkipValue < (INTN) SavedMenuOption->Skip) {
- TopOfScreen = Link;
- OldSkipValue = SkipValue;
+
+ //
+ // Found the menu which will show at the top of the page.
+ //
+ if (Link == NewPos) {
+ //
+ // The menu can show more than one pages, just show the menu at the top of the page.
+ //
+ SkipValue = 0;
+ TopOfScreen = Link;
+ OldSkipValue = SkipValue;
} else {
- SkipValue = 0;
- TopOfScreen = Link->ForwardLink;
+ //
+ // Check whether need to skip some line for menu shows at the top of the page.
+ //
+ SkipValue = Index - BottomRow - 1;
+ if (SkipValue > 0 && SkipValue < (INTN) SavedMenuOption->Skip) {
+ TopOfScreen = Link;
+ OldSkipValue = SkipValue;
+ } else {
+ SkipValue = 0;
+ TopOfScreen = Link->ForwardLink;
+ }
}
Repaint = TRUE;
|