https://git.reactos.org/?p=reactos.git;a=commitdiff;h=38cbe5acc36dfdebab03f…
commit 38cbe5acc36dfdebab03f8a9b70a20a0c180c56c
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 20 20:59:53 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Feb 21 02:54:06 2022 +0100
[FREELDR] Update documentation following timeout and UI style work.
---
boot/freeldr/FREELDR.INI | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/boot/freeldr/FREELDR.INI b/boot/freeldr/FREELDR.INI
index ddb9a88277d..1887ac78017 100644
--- a/boot/freeldr/FREELDR.INI
+++ b/boot/freeldr/FREELDR.INI
@@ -12,8 +12,9 @@
; Debug - FreeLoader debugging port parameters, e.g.
; /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200
; MessageBox - Displays the specified text in a message box upon startup.
+; The text can be escaped for newlines (\n).
; DefaultOS - Specifies which OS listed is the default choice.
-; TimeOut - Sets the timeout (in seconds) before the first OS listed
+; TimeOut - Sets the countdown (in seconds) before the first OS listed
; gets booted automatically.
; [Display] Section Commands:
@@ -28,12 +29,17 @@
; 0x502B for 80x43
; 0x503C for 80x60
;
-; TitleText - Text that is displayed in the title box.
+; TitleText - Text being displayed in the title box.
+; TimeText - Text being displayed for the timeout countdown.
+; It can be escaped (with a single %d) for the countdown
+; to be inserted at a specific place, instead of being
+; appended at the end.
; StatusBarColor - Color of status bar's background.
; StatusBarTextColor - Color of status bar's text.
; BackdropTextColor - Color of the backdrop's fill.
; BackdropColor - Color of the backdrop's background.
-; BackdropFillStyle - Backdrop fill style - can be: Light, Medium, Dark.
+; BackdropFillStyle - Backdrop fill style, can be one of the following:
+; None, Light, Medium, Dark.
; TitleBoxTextColor - Title box text color.
; TitleBoxColor - Title box background color.
; MessageBoxTextColor - Message box text color.
@@ -43,6 +49,12 @@
; TextColor - Normal text color.
; SelectedTextColor - Selected text color.
; SelectedColor - Selected text background color.
+;
+; ShowTime - Shows the current time ("Yes") or not ("No").
+; MenuBox - Draws a box around the menu ("Yes") or not ("No").
+; CenterMenu - Uses a centered ("Yes") or left-aligned ("No") menu.
+; MinimalUI - Uses a minimal NTLDR-like ("Yes") or a full-fledged
+; ("No") Text User Interface.
; SpecialEffects - Turns on ("Yes") or off ("No") video special effects.
;
; Background colors can be any one of the following:
@@ -175,6 +187,10 @@ MenuColor=Blue
TextColor=Yellow
SelectedTextColor=Black
SelectedColor=Gray
+ShowTime=Yes
+MenuBox=Yes
+CenterMenu=Yes
+MinimalUI=No
SpecialEffects=Yes
[Operating Systems]
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=63833c769f4844f300b5b…
commit 63833c769f4844f300b5be69fa8e28b406eec7c3
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 20 20:56:33 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Feb 21 02:54:05 2022 +0100
[FREELDR] Update existing FREELDR.INI documentation.
---
boot/freeldr/FREELDR.INI | 88 ++++++++++++++++++++++++------------------------
1 file changed, 44 insertions(+), 44 deletions(-)
diff --git a/boot/freeldr/FREELDR.INI b/boot/freeldr/FREELDR.INI
index 48561fc4475..ddb9a88277d 100644
--- a/boot/freeldr/FREELDR.INI
+++ b/boot/freeldr/FREELDR.INI
@@ -11,14 +11,14 @@
;
; Debug - FreeLoader debugging port parameters, e.g.
; /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200
-; MessageBox - displays the specified text in a message box upon bootup.
-; DefaultOS - specifies which OS listed is the default choice.
-; TimeOut - sets the timeout (in seconds) before the first OS listed
+; MessageBox - Displays the specified text in a message box upon startup.
+; DefaultOS - Specifies which OS listed is the default choice.
+; TimeOut - Sets the timeout (in seconds) before the first OS listed
; gets booted automatically.
; [Display] Section Commands:
;
-; DisplayMode - sets the video mode to be used by FreeLoader.
+; DisplayMode - Sets the video mode to be used by FreeLoader.
; The following values are supported:
; NORMAL_VGA for 80x25
; EXTENDED_VGA for 80x50 on VGA 80x43 on EGA
@@ -28,22 +28,22 @@
; 0x502B for 80x43
; 0x503C for 80x60
;
-; TitleText - text that is displayed in the title box.
-; StatusBarColor - color of status bar's background.
-; StatusBarTextColor - color of status bar's text.
-; BackdropTextColor - color of the backdrop's fill.
-; BackdropColor - color of the backdrop's background.
-; BackdropFillStyle - backdrop fill style - can be: Light, Medium, Dark.
-; TitleBoxTextColor - title box text color.
-; TitleBoxColor - title box background color.
-; MessageBoxTextColor - message box text color.
-; MessageBoxColor - message box background color.
-; MenuTextColor - menu text color.
-; MenuColor - menu color.
-; TextColor - normal text color.
-; SelectedTextColor - selected text color.
-; SelectedColor - selected text background color.
-; SpecialEffects - turns on ("Yes") or off ("No") video special effects.
+; TitleText - Text that is displayed in the title box.
+; StatusBarColor - Color of status bar's background.
+; StatusBarTextColor - Color of status bar's text.
+; BackdropTextColor - Color of the backdrop's fill.
+; BackdropColor - Color of the backdrop's background.
+; BackdropFillStyle - Backdrop fill style - can be: Light, Medium, Dark.
+; TitleBoxTextColor - Title box text color.
+; TitleBoxColor - Title box background color.
+; MessageBoxTextColor - Message box text color.
+; MessageBoxColor - Message box background color.
+; MenuTextColor - Menu text color.
+; MenuColor - Menu color.
+; TextColor - Normal text color.
+; SelectedTextColor - Selected text color.
+; SelectedColor - Selected text background color.
+; SpecialEffects - Turns on ("Yes") or off ("No") video special effects.
;
; Background colors can be any one of the following:
; Black, Blue, Green, Cyan, Red, Magenta, Brown, Gray.
@@ -57,31 +57,31 @@
; [OS-General] Section Commands:
;
-; BootType - specifies the boot type: Windows, WindowsNT40, Windows2003,
+; BootType - Specifies the boot type: Windows, WindowsNT40, Windows2003,
; ReactOSSetup, Linux, BootSector, Partition, Drive
; BootPath - ARC path, e.g. multi(0)disk(0)rdisk(x)partition(y)
-; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0
-; maps harddisk1 to harddisk0 or DriveMap=fd1,fd0).
+; DriveMap - Maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0
+; maps harddisk1 to harddisk0; or DriveMap=fd1,fd0).
; ["Drive" OSType] Section Commands:
;
-; BootDrive - specifies the BIOS drive number to be used.
+; BootDrive - BIOS drive number to be used.
;
; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
; over the "BootDrive" value.
; ["Partition" OSType] Section Commands:
;
-; BootDrive - specifies the BIOS drive number to be used.
-; BootPartition - specifies the partition number to be used (default: 0).
+; BootDrive - BIOS drive number to be used.
+; BootPartition - Partition number to be used (default: 0).
;
; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
; over both the "BootDrive" and "BootPartition" values.
; ["BootSector" OSType] Section Commands:
;
-; BootDrive - specifies the BIOS drive number to be used.
-; BootPartition - specifies the partition number to be used (cannot be 0).
+; BootDrive - BIOS drive number to be used.
+; BootPartition - Partition number to be used (cannot be 0).
;
; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
; over both the "BootDrive" and "BootPartition" values.
@@ -90,7 +90,7 @@
; If none of them are given and a relative file path is specified by the
; "BootSectorFile" value, the default boot partition will be used instead.
;
-; BootSectorFile - specifies the file name of the bootsector to be loaded.
+; BootSectorFile - File name of the bootsector to be loaded.
; It can be either relative to "BootDrive" and "BootPartition"
; (or to "BootPath"), or be an absolute ARC path, in which case
; the "BootDrive" and "BootPartition" (or "BootPath") values
@@ -98,8 +98,8 @@
; ["Linux" OSType] Section Commands:
;
-; BootDrive - specifies the BIOS drive number to be used.
-; BootPartition - specifies the partition number to be used (cannot be 0).
+; BootDrive - BIOS drive number to be used.
+; BootPartition - Partition number to be used (cannot be 0).
;
; REMARK: If a "BootPath" ARC path is specified, its value takes precedence
; over both the "BootDrive" and "BootPartition" values.
@@ -108,37 +108,37 @@
; If none of them are given and a relative file path is specified by the
; "Kernel" or "Initrd" values, the default boot partition will be used instead.
;
-; Kernel - specifies the kernel file name to be used.
+; Kernel - Kernel file name to be used.
; It can be either relative to "BootDrive" and "BootPartition"
; (or to "BootPath"), or be an absolute ARC path, in which case
; the "BootDrive" and "BootPartition" (or "BootPath") values
; will only be used to set the boot partition.
-; Initrd - specifies the optional init ramdisk file name to be used.
-; The same remarks about the path as for "Kernel" remain valid.
-; CommandLine - specifies the boot load options for the kernel.
+; Initrd - Optional init ramdisk file name to be used.
+; The same remarks about the path for "Kernel" also apply here.
+; CommandLine - Boot load options for the kernel.
; ["Windows(NT40|2003)" OSType] Section Commands:
;
-; SystemPath - specifies the system root path (must be a valid ARC path):
+; SystemPath - System root path (must be a valid ARC path), e.g.
; multi(0)disk(0)rdisk(0)partition(1)\reactos
; multi(0)disk(0)fdisk(0)
-; Options - specifies the boot load options for the kernel.
-; Kernel - specifies the kernel file name (default: ntoskrnl.exe)
-; Hal - specifies the HAL file name (default: hal.dll)
+; Options - Boot load options for the kernel.
+; Kernel - Kernel file name (default: ntoskrnl.exe)
+; Hal - HAL file name (default: hal.dll)
;
; REMARK: The "Kernel" and "Hal" values can be either relative to "SystemPath",
-; or be an absolute ARC path. Also they can alternatively be specified using the
-; NT-compatible "/HAL=filename" and "/KERNEL=filename" option switches to the
-; "Options" value, in which case the latter ones take precedence.
+; or be an absolute ARC path. Also they can alternatively be specified using
+; the NT-compatible "/HAL=filename" and "/KERNEL=filename" option switches to
+; the "Options" value, in which case the latter ones take precedence.
; ["ReactOSSetup" OSType] Section Commands:
;
; This OS type is used to start the SETUP portion of NT / ReactOS.
;
-; SystemPath - specifies the system root path (must be a valid ARC path):
+; SystemPath - System root path (must be a valid ARC path), e.g.
; multi(0)disk(0)rdisk(0)partition(1)\reactos
; multi(0)disk(0)fdisk(0)
-; Options - specifies extra boot load options for the kernel and the
+; Options - Extra boot load options for the kernel and the
; setup environment (see REMARK 2 below).
;
; REMARK: Contrary to the "Windows" type, this OS type does not support separate
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3599c835f6f63ef977698…
commit 3599c835f6f63ef977698ecc945b0f56e16c0bba
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 20 03:01:13 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Feb 21 02:54:01 2022 +0100
[FREELDR:UI] Improve menu timeout drawing.
Fixes CORE-13827, where the timer countdown would otherwise display
incorrectly if there were no trailing spaces after the timer string.
Now, the countdown is always appended with one space separator after
the end of the string, **or**, it is inserted at a specific place
delimited by a %d insertion point in the string.
Also, don't repaint the date & time (in full-UI mode) many times per
second -- instead of only once per second -- while displaying a menu.
---
boot/freeldr/freeldr/ui/directui.c | 2 +-
boot/freeldr/freeldr/ui/tuimenu.c | 225 ++++++++++++++++++++++++-------------
boot/freeldr/freeldr/ui/ui.c | 2 +-
3 files changed, 148 insertions(+), 81 deletions(-)
diff --git a/boot/freeldr/freeldr/ui/directui.c b/boot/freeldr/freeldr/ui/directui.c
index 68d67777190..f34f1dc2158 100644
--- a/boot/freeldr/freeldr/ui/directui.c
+++ b/boot/freeldr/freeldr/ui/directui.c
@@ -19,7 +19,7 @@ UCHAR UiMenuBgColor = COLOR_BLACK;
UCHAR UiTextColor = COLOR_GRAY;
UCHAR UiSelectedTextColor = COLOR_BLACK;
UCHAR UiSelectedTextBgColor = COLOR_GRAY;
-CHAR UiTimeText[260] = "Seconds until highlighted choice will be started automatically: ";
+CHAR UiTimeText[260] = "Seconds until highlighted choice will be started automatically:";
/* FUNCTIONS ******************************************************************/
diff --git a/boot/freeldr/freeldr/ui/tuimenu.c b/boot/freeldr/freeldr/ui/tuimenu.c
index f20e7c2cbfa..548d209e42b 100644
--- a/boot/freeldr/freeldr/ui/tuimenu.c
+++ b/boot/freeldr/freeldr/ui/tuimenu.c
@@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: FreeLoader
* FILE: boot/freeldr/freeldr/ui/tuimenu.c
- * PURPOSE: UI Menu Functions
+ * PURPOSE: Text UI Menu Functions
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* Brian Palmer (brianp(a)sginet.com)
*/
@@ -22,6 +22,10 @@ TuiProcessMenuKeyboardEvent(
_In_ PUI_MENU_INFO MenuInfo,
_In_ UiMenuKeyPressFilterCallback KeyPressFilter);
+static VOID
+TuiDrawMenuTimeout(
+ _In_ PUI_MENU_INFO MenuInfo);
+
BOOLEAN
TuiDisplayMenu(
IN PCSTR MenuHeader,
@@ -106,36 +110,35 @@ TuiDisplayMenu(
if (KeyPress == KEY_ENTER) break;
if (CanEscape && KeyPress == KEY_ESC) return FALSE;
+ /* Get the updated time, and check if more than a second has elapsed */
+ CurrentClockSecond = ArcGetTime()->Second;
+ if (CurrentClockSecond != LastClockSecond)
+ {
+ /* Update the time information */
+ LastClockSecond = CurrentClockSecond;
+
#ifndef _M_ARM // FIXME: Theme-specific
- /* Update the date & time */
- TuiUpdateDateTime();
- VideoCopyOffScreenBufferToVRAM();
+ /* Update the date & time */
+ TuiUpdateDateTime();
#endif
- /* Check if there is a countdown */
- if (MenuInformation.MenuTimeRemaining > 0)
- {
- /* Get the updated time, seconds only */
- CurrentClockSecond = ArcGetTime()->Second;
-
- /* Check if more than a second has now elapsed */
- if (CurrentClockSecond != LastClockSecond)
+ /* If there is a countdown, update it */
+ if (MenuInformation.MenuTimeRemaining > 0)
{
- /* Update the time information */
- LastClockSecond = CurrentClockSecond;
MenuInformation.MenuTimeRemaining--;
-
- /* Update the menu */
- TuiDrawMenuBox(&MenuInformation);
+ TuiDrawMenuTimeout(&MenuInformation);
+ }
+ else if (MenuInformation.MenuTimeRemaining == 0)
+ {
+ /* A timeout occurred, exit this loop and return selection */
#ifndef _M_ARM
VideoCopyOffScreenBufferToVRAM();
#endif
+ break;
}
- }
- else if (MenuInformation.MenuTimeRemaining == 0)
- {
- /* A time out occurred, exit this loop and return default OS */
- break;
+#ifndef _M_ARM
+ VideoCopyOffScreenBufferToVRAM();
+#endif
}
#ifndef _M_ARM
@@ -267,94 +270,158 @@ TuiDrawMenu(
#endif
}
-VOID
-TuiDrawMenuBox(
+static VOID
+TuiDrawMenuTimeout(
_In_ PUI_MENU_INFO MenuInfo)
{
- CHAR MenuLineText[80], TempString[80];
- ULONG i;
-
-#ifndef _M_ARM // FIXME: Theme-specific
- /* Draw the menu box if requested */
- if (UiMenuBox)
- {
- UiDrawBox(MenuInfo->Left,
- MenuInfo->Top,
- MenuInfo->Right,
- MenuInfo->Bottom,
- D_VERT,
- D_HORZ,
- FALSE, // Filled
- TRUE, // Shadow
- ATTR(UiMenuFgColor, UiMenuBgColor));
- }
-#endif
+ ULONG Length;
+ CHAR MenuLineText[80];
- /* If there is a timeout draw the time remaining */
+ /* If there is a timeout, draw the time remaining */
if (MenuInfo->MenuTimeRemaining >= 0)
{
- /* Copy the integral time text string, and remove the last 2 chars */
- strcpy(TempString, UiTimeText);
- i = (ULONG)strlen(TempString);
- TempString[i - 2] = 0;
-
- /* Display the first part of the string and the remaining time */
- strcpy(MenuLineText, TempString);
- _itoa(MenuInfo->MenuTimeRemaining, TempString, 10);
- strcat(MenuLineText, TempString);
-
- /* Add the last 2 chars */
- strcat(MenuLineText, &UiTimeText[i - 2]);
+ /* Find whether the time text string is escaped
+ * with %d for specific countdown insertion. */
+ PCHAR ptr = UiTimeText;
+ while ((ptr = strchr(ptr, '%')) && (ptr[1] != 'd'))
+ {
+ /* Ignore any following character (including a following
+ * '%' that would be escaped), thus skip two characters.
+ * If this is the last character, ignore it and stop. */
+ if (*++ptr)
+ ++ptr;
+ }
+ ASSERT(!ptr || (ptr[0] == '%' && ptr[1] == 'd'));
-#ifndef _M_ARM
- /* Check if this is a centered menu */
- if (UiCenterMenu)
+ if (ptr)
{
- /* Display it in the center of the menu */
- UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1,
- MenuInfo->Bottom,
- MenuLineText,
- ATTR(UiMenuFgColor, UiMenuBgColor));
+ /* Copy the time text string up to the '%d' insertion point and
+ * skip it, add the remaining time and the rest of the string. */
+ RtlStringCbPrintfA(MenuLineText, sizeof(MenuLineText),
+ "%.*s%d%s",
+ ptr - UiTimeText, UiTimeText,
+ MenuInfo->MenuTimeRemaining,
+ ptr + 2);
}
else
-#endif
{
- /* Display under the menu directly */
- UiDrawText(0,
- MenuInfo->Bottom + 4,
- MenuLineText,
- ATTR(UiMenuFgColor, UiMenuBgColor));
+ /* Copy the time text string, append a separating blank,
+ * and add the remaining time. */
+ RtlStringCbPrintfA(MenuLineText, sizeof(MenuLineText),
+ "%s %d",
+ UiTimeText,
+ MenuInfo->MenuTimeRemaining);
}
+
+ Length = (ULONG)strlen(MenuLineText);
}
else
{
- /* Erase the timeout string with spaces, and 0-terminate for sure */
- for (i = 0; i < sizeof(MenuLineText)-1; i++)
+ /* Erase the timeout with blanks */
+ Length = 0;
+ }
+
+ /**
+ * How to pad/fill:
+ *
+ * Center Box What to do:
+ * 0 0 or 1 Pad on the right with blanks.
+ * 1 0 Pad on the left with blanks.
+ * 1 1 Pad on the left with blanks + box bottom border.
+ **/
+
+#ifndef _M_ARM
+ if (UiCenterMenu)
+ {
+ /* In boxed menu mode, pad on the left with blanks and box border,
+ * otherwise, pad over all the box length until its right edge. */
+ TuiFillArea(0,
+ MenuInfo->Bottom,
+ UiMenuBox
+ ? MenuInfo->Left - 1 /* Left side of the box bottom */
+ : MenuInfo->Right, /* Left side + all box length */
+ MenuInfo->Bottom,
+ UiBackdropFillStyle,
+ ATTR(UiBackdropFgColor, UiBackdropBgColor));
+
+ if (UiMenuBox)
{
- MenuLineText[i] = ' ';
+ /* Fill with box bottom border */
+ TuiDrawBoxBottomLine(MenuInfo->Left,
+ MenuInfo->Bottom,
+ MenuInfo->Right,
+ D_VERT,
+ D_HORZ,
+ ATTR(UiMenuFgColor, UiMenuBgColor));
+
+ /* In centered boxed menu mode, the timeout string
+ * does not go past the right border, in principle... */
}
- MenuLineText[sizeof(MenuLineText)-1] = 0;
- /* Draw this "empty" string to erase */
-#ifndef _M_ARM
- if (UiCenterMenu)
+ if (Length > 0)
{
- UiDrawText(MenuInfo->Right - (ULONG)strlen(MenuLineText) - 1,
+ /* Display the timeout at the bottom-right part of the menu */
+ UiDrawText(MenuInfo->Right - Length - 1,
MenuInfo->Bottom,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
- else
+ }
+ else
#endif
+ {
+ if (Length > 0)
{
+ /* Display the timeout under the menu directly */
UiDrawText(0,
MenuInfo->Bottom + 4,
MenuLineText,
ATTR(UiMenuFgColor, UiMenuBgColor));
}
+
+ /* Pad on the right with blanks, to erase
+ * characters when the string length decreases. */
+ TuiFillArea(Length,
+ MenuInfo->Bottom + 4,
+ Length ? (Length + 1) : (UiScreenWidth - 1),
+ MenuInfo->Bottom + 4,
+#ifndef _M_ARM
+ UiBackdropFillStyle,
+ ATTR(UiBackdropFgColor, UiBackdropBgColor)
+#else
+ 0, // ' '
+ ATTR(UiTextColor, COLOR_BLACK) // UiMenuBgColor
+#endif
+ );
}
}
+VOID
+TuiDrawMenuBox(
+ _In_ PUI_MENU_INFO MenuInfo)
+{
+#ifndef _M_ARM // FIXME: Theme-specific
+ /* Draw the menu box if requested */
+ if (UiMenuBox)
+ {
+ UiDrawBox(MenuInfo->Left,
+ MenuInfo->Top,
+ MenuInfo->Right,
+ MenuInfo->Bottom,
+ D_VERT,
+ D_HORZ,
+ FALSE, // Filled
+ TRUE, // Shadow
+ ATTR(UiMenuFgColor, UiMenuBgColor));
+ }
+
+ /* Update the date & time */
+ TuiUpdateDateTime();
+#endif
+
+ TuiDrawMenuTimeout(MenuInfo);
+}
+
VOID
TuiDrawMenuItem(
_In_ PUI_MENU_INFO MenuInfo,
@@ -473,7 +540,7 @@ TuiProcessMenuKeyboardEvent(
{
/* Cancel it and remove it */
MenuInfo->MenuTimeRemaining = -1;
- TuiDrawMenuBox(MenuInfo); // FIXME: Remove for minimal UI too
+ TuiDrawMenuTimeout(MenuInfo);
}
/* Get the key (get the extended key if needed) */
diff --git a/boot/freeldr/freeldr/ui/ui.c b/boot/freeldr/freeldr/ui/ui.c
index 7d13d81ef16..513cabfc195 100644
--- a/boot/freeldr/freeldr/ui/ui.c
+++ b/boot/freeldr/freeldr/ui/ui.c
@@ -52,7 +52,7 @@ BOOLEAN UiUseSpecialEffects = FALSE; // Tells us if we should use fade effect
BOOLEAN UiDrawTime = TRUE; // Tells us if we should draw the time
BOOLEAN UiCenterMenu = TRUE; // Tells us if we should use a centered or left-aligned menu
BOOLEAN UiMenuBox = TRUE; // Tells us if we should draw a box around the menu
-CHAR UiTimeText[260] = "[Time Remaining: ] ";
+CHAR UiTimeText[260] = "[Time Remaining: %d]";
const CHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
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)
{