https://git.reactos.org/?p=reactos.git;a=commitdiff;h=622a90522d80d37e9d946…
commit 622a90522d80d37e9d946ac0d1e169b2ca92e3a3
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 20 02:52:40 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Feb 21 02:53:59 2022 +0100
[FREELDR:UI] Fix the painting ordering of menu elements.
---
boot/freeldr/freeldr/ui/minitui.c | 18 ++++++++---------
boot/freeldr/freeldr/ui/tuimenu.c | 42 +++++++++++++++++++++------------------
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/boot/freeldr/freeldr/ui/minitui.c b/boot/freeldr/freeldr/ui/minitui.c
index ae2ae004fa3..694072fe65a 100644
--- a/boot/freeldr/freeldr/ui/minitui.c
+++ b/boot/freeldr/freeldr/ui/minitui.c
@@ -163,6 +163,15 @@ MiniTuiDrawMenu(
ATTR(UiMenuFgColor, UiMenuBgColor));
}
+ /* Draw the menu box */
+ TuiDrawMenuBox(MenuInfo);
+
+ /* Draw each line of the menu */
+ for (i = 0; i < MenuInfo->MenuItemCount; ++i)
+ {
+ TuiDrawMenuItem(MenuInfo, i);
+ }
+
/* Now tell the user how to choose */
UiVtbl.DrawText(0,
MenuInfo->Bottom + 1,
@@ -182,15 +191,6 @@ MiniTuiDrawMenu(
ATTR(UiMenuFgColor, UiMenuBgColor));
}
- /* Draw the menu box */
- TuiDrawMenuBox(MenuInfo);
-
- /* Draw each line of the menu */
- for (i = 0; i < MenuInfo->MenuItemCount; i++)
- {
- TuiDrawMenuItem(MenuInfo, i);
- }
-
/* Display the boot options if needed */
if (MenuInfo->ShowBootOptions)
{
diff --git a/boot/freeldr/freeldr/ui/tuimenu.c b/boot/freeldr/freeldr/ui/tuimenu.c
index 500a8995467..f20e7c2cbfa 100644
--- a/boot/freeldr/freeldr/ui/tuimenu.c
+++ b/boot/freeldr/freeldr/ui/tuimenu.c
@@ -162,7 +162,7 @@ TuiCalcMenuBoxSize(
Height -= 1; // Height is zero-based
/* Loop every item */
- for (i = 0; i < MenuInfo->MenuItemCount; i++)
+ for (i = 0; i < MenuInfo->MenuItemCount; ++i)
{
/* Get the string length and make it become the new width if necessary */
if (MenuInfo->MenuItemList[i])
@@ -203,7 +203,10 @@ TuiDrawMenu(
{
ULONG i;
-#ifdef _M_ARM // FIXME: Theme-specific
+#ifndef _M_ARM // FIXME: Theme-specific
+ /* Draw the backdrop */
+ UiDrawBackdrop();
+#else
/* No GUI status bar text, just minimal text. Show the menu header. */
if (MenuInfo->MenuHeader)
@@ -214,6 +217,24 @@ TuiDrawMenu(
ATTR(UiMenuFgColor, UiMenuBgColor));
}
+#endif
+
+ /* Draw the menu box */
+ TuiDrawMenuBox(MenuInfo);
+
+ /* Draw each line of the menu */
+ for (i = 0; i < MenuInfo->MenuItemCount; ++i)
+ {
+ TuiDrawMenuItem(MenuInfo, i);
+ }
+
+#ifndef _M_ARM // FIXME: Theme-specific
+
+ /* Update the status bar */
+ UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
+
+#else
+
/* Now tell the user how to choose */
UiDrawText(0,
MenuInfo->Bottom + 1,
@@ -233,25 +254,8 @@ TuiDrawMenu(
ATTR(UiMenuFgColor, UiMenuBgColor));
}
-#else
-
- /* Draw the backdrop */
- UiDrawBackdrop();
-
- /* Update the status bar */
- UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
-
#endif
- /* Draw the menu box */
- TuiDrawMenuBox(MenuInfo);
-
- /* Draw each line of the menu */
- for (i = 0; i < MenuInfo->MenuItemCount; i++)
- {
- TuiDrawMenuItem(MenuInfo, i);
- }
-
/* Display the boot options if needed */
if (MenuInfo->ShowBootOptions)
{