[FREELDR:UI] Fix the painting ordering of menu elements.

This commit is contained in:
Hermès Bélusca-Maïto 2022-02-20 02:52:40 +01:00
parent 5239a0ca4d
commit 622a90522d
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 32 additions and 28 deletions

View file

@ -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)
{

View file

@ -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)
{