mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 09:20:30 +00:00
[FREELDR] MiniTui: Fix progress bar width on custom resolutions (#1964)
+ Sync with the "direct-UI" i.e. with less bugs. Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
parent
457612702b
commit
183a81ee82
1 changed files with 8 additions and 7 deletions
|
@ -4,7 +4,7 @@
|
||||||
* FILE: boot/freeldr/freeldr/ui/minitui.c
|
* FILE: boot/freeldr/freeldr/ui/minitui.c
|
||||||
* PURPOSE: Mini Text UI interface
|
* PURPOSE: Mini Text UI interface
|
||||||
* PROGRAMMERS: Brian Palmer <brianp@sginet.com>
|
* PROGRAMMERS: Brian Palmer <brianp@sginet.com>
|
||||||
* Hervé Poussineau
|
* Hervé Poussineau
|
||||||
*/
|
*/
|
||||||
#ifndef _M_ARM
|
#ifndef _M_ARM
|
||||||
#include <freeldr.h>
|
#include <freeldr.h>
|
||||||
|
@ -31,23 +31,24 @@ VOID MiniTuiDrawStatusText(PCSTR StatusText)
|
||||||
|
|
||||||
VOID MiniTuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
|
VOID MiniTuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
|
||||||
{
|
{
|
||||||
ULONG Left, Top, Right, Bottom;
|
ULONG Left, Top, Right, Bottom, Width, Height;
|
||||||
ULONG Width = 50; // Allow for 50 "bars"
|
|
||||||
ULONG Height = 2;
|
|
||||||
|
|
||||||
Width = 80;
|
/* Build the coordinates and sizes */
|
||||||
|
Height = 2;
|
||||||
|
Width = UiScreenWidth;
|
||||||
Left = 0;
|
Left = 0;
|
||||||
Right = Left + Width;
|
Right = (Left + Width) - 1;
|
||||||
Top = UiScreenHeight - Height - 4;
|
Top = UiScreenHeight - Height - 4;
|
||||||
Bottom = Top + Height + 1;
|
Bottom = Top + Height + 1;
|
||||||
|
|
||||||
|
/* Draw the progress bar */
|
||||||
MiniTuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
|
MiniTuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MiniTuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
|
VOID MiniTuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
ULONG ProgressBarWidth = (Right - Left) - 4;
|
ULONG ProgressBarWidth = (Right - Left) - 3;
|
||||||
|
|
||||||
// First make sure the progress bar text fits
|
// First make sure the progress bar text fits
|
||||||
UiTruncateStringEllipsis(ProgressText, ProgressBarWidth - 4);
|
UiTruncateStringEllipsis(ProgressText, ProgressBarWidth - 4);
|
||||||
|
|
Loading…
Reference in a new issue