Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
chg - Do it for the remaining occurrences
Browse files Browse the repository at this point in the history
---

Type: chg
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Mar 10, 2024
1 parent c4f20d2 commit 39b86c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions GRILO.Bootloader/Boot/Style/Styles/GrubBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override string Render()

// Now, render a box
builder.Append(
BorderColor.RenderBorder(2, 4, ConsoleWrapper.WindowWidth - 6, Console.WindowHeight - 15, new Color(boxBorderColor))
BorderColor.RenderBorder(2, 4, ConsoleWrapper.WindowWidth - 6, ConsoleWrapper.WindowHeight - 15, new Color(boxBorderColor))
);

// Offer help for new users
Expand All @@ -60,7 +60,7 @@ public override string Render()
$"before booting or `c' for a command line.";
int longest = help.Split(['\n']).Max((text) => text.Length);
builder.Append(
TextWriterWhereColor.RenderWhereColor(help, Console.WindowWidth / 2 - longest / 2 - 2, Console.WindowHeight - 8, new Color(sectionTitle))
TextWriterWhereColor.RenderWhereColor(help, ConsoleWrapper.WindowWidth / 2 - longest / 2 - 2, ConsoleWrapper.WindowHeight - 8, new Color(sectionTitle))
);
return builder.ToString();
}
Expand All @@ -75,7 +75,7 @@ public override string RenderHighlight(int chosenBootEntry)
// Populate boot entries inside the box
var bootApps = BootManager.GetBootApps();
(int, int) upperLeftCornerInterior = (3, 5);
(int, int) lowerLeftCornerInterior = (3, Console.WindowHeight - 9);
(int, int) lowerLeftCornerInterior = (3, ConsoleWrapper.WindowHeight - 9);
int maxItemsPerPage = lowerLeftCornerInterior.Item2 - upperLeftCornerInterior.Item2 - 1;
int currentPage = (int)Math.Truncate(chosenBootEntry / (double)maxItemsPerPage);
int startIndex = maxItemsPerPage * currentPage;
Expand All @@ -90,7 +90,7 @@ public override string RenderHighlight(int chosenBootEntry)
var finalColorBg = i == chosenBootEntry ? highlightedEntry : normalEntry;
var finalColorFg = i == chosenBootEntry ? normalEntry : highlightedEntry;
builder.Append(
TextWriterWhereColor.RenderWhereColorBack(rendered + new string(' ', Console.WindowWidth - 6 - rendered.Length), upperLeftCornerInterior.Item1, upperLeftCornerInterior.Item2 + renderedAnswers, false, new Color(finalColorFg), new Color(finalColorBg))
TextWriterWhereColor.RenderWhereColorBack(rendered + new string(' ', ConsoleWrapper.WindowWidth - 6 - rendered.Length), upperLeftCornerInterior.Item1, upperLeftCornerInterior.Item2 + renderedAnswers, false, new Color(finalColorFg), new Color(finalColorBg))
);
renderedAnswers++;
}
Expand All @@ -103,13 +103,13 @@ public override string RenderBootFailedMessage(string content) =>
public override string RenderSelectTimeout(int timeout)
{
string help = $"The highlighted entry will be executed automatically in {timeout}s. ";
return TextWriterWhereColor.RenderWhereColor(help, 4, Console.WindowHeight - 5, true, new Color(ConsoleColor.White));
return TextWriterWhereColor.RenderWhereColor(help, 4, ConsoleWrapper.WindowHeight - 5, true, new Color(ConsoleColor.White));
}

public override string ClearSelectTimeout()
{
string help = $"The highlighted entry will be executed automatically in {Config.Instance.BootSelectTimeoutSeconds}s. ";
return TextWriterWhereColor.RenderWhereColor(new string(' ', help.Length), 4, Console.WindowHeight - 5, true, new Color(ConsoleColor.White));
return TextWriterWhereColor.RenderWhereColor(new string(' ', help.Length), 4, ConsoleWrapper.WindowHeight - 5, true, new Color(ConsoleColor.White));
}
}
}
12 changes: 6 additions & 6 deletions GRILO.Bootloader/Boot/Style/Styles/GrubLegacyBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override string Render()

// Now, render a box
builder.Append(
BorderColor.RenderBorder(2, 4, ConsoleWrapper.WindowWidth - 6, Console.WindowHeight - 15, new Color(boxBorderColor))
BorderColor.RenderBorder(2, 4, ConsoleWrapper.WindowWidth - 6, ConsoleWrapper.WindowHeight - 15, new Color(boxBorderColor))
);

// Offer help for new users
Expand All @@ -60,7 +60,7 @@ public override string Render()
$"commands before booting or `c' for a command line.";
int longest = help.Split(['\n']).Max((text) => text.Length);
builder.Append(
TextWriterWhereColor.RenderWhereColor(help, Console.WindowWidth / 2 - longest / 2 - 2, Console.WindowHeight - 8, new Color(sectionTitle))
TextWriterWhereColor.RenderWhereColor(help, ConsoleWrapper.WindowWidth / 2 - longest / 2 - 2, ConsoleWrapper.WindowHeight - 8, new Color(sectionTitle))
);
return builder.ToString();
}
Expand All @@ -75,7 +75,7 @@ public override string RenderHighlight(int chosenBootEntry)
// Populate boot entries inside the box
var bootApps = BootManager.GetBootApps();
(int, int) upperLeftCornerInterior = (3, 5);
(int, int) lowerLeftCornerInterior = (3, Console.WindowHeight - 9);
(int, int) lowerLeftCornerInterior = (3, ConsoleWrapper.WindowHeight - 9);
int maxItemsPerPage = lowerLeftCornerInterior.Item2 - upperLeftCornerInterior.Item2 - 1;
int currentPage = (int)Math.Truncate(chosenBootEntry / (double)maxItemsPerPage);
int startIndex = maxItemsPerPage * currentPage;
Expand All @@ -90,7 +90,7 @@ public override string RenderHighlight(int chosenBootEntry)
var finalColorBg = i == chosenBootEntry ? highlightedEntry : normalEntry;
var finalColorFg = i == chosenBootEntry ? normalEntry : highlightedEntry;
builder.Append(
TextWriterWhereColor.RenderWhereColorBack(rendered + new string(' ', Console.WindowWidth - 6 - rendered.Length), upperLeftCornerInterior.Item1, upperLeftCornerInterior.Item2 + renderedAnswers, false, new Color(finalColorFg), new Color(finalColorBg))
TextWriterWhereColor.RenderWhereColorBack(rendered + new string(' ', ConsoleWrapper.WindowWidth - 6 - rendered.Length), upperLeftCornerInterior.Item1, upperLeftCornerInterior.Item2 + renderedAnswers, false, new Color(finalColorFg), new Color(finalColorBg))
);
renderedAnswers++;
}
Expand All @@ -110,13 +110,13 @@ public override string RenderBootFailedMessage(string content) =>
public override string RenderSelectTimeout(int timeout)
{
string help = $"The highlighted entry will be executed automatically in {timeout}s. ";
return TextWriterWhereColor.RenderWhereColor(help, 4, Console.WindowHeight - 5, true, new Color(ConsoleColor.White));
return TextWriterWhereColor.RenderWhereColor(help, 4, ConsoleWrapper.WindowHeight - 5, true, new Color(ConsoleColor.White));
}

public override string ClearSelectTimeout()
{
string help = $"The highlighted entry will be executed automatically in {Config.Instance.BootSelectTimeoutSeconds}s. ";
return TextWriterWhereColor.RenderWhereColor(new string(' ', help.Length), 4, Console.WindowHeight - 5, true, new Color(ConsoleColor.White));
return TextWriterWhereColor.RenderWhereColor(new string(' ', help.Length), 4, ConsoleWrapper.WindowHeight - 5, true, new Color(ConsoleColor.White));
}
}
}
10 changes: 5 additions & 5 deletions GRILO.Bootloader/Boot/Style/Styles/LiloBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override string Render()
int bootPrompt = 16;
int halfX = ConsoleWrapper.WindowWidth / 2 - (interiorWidth + 2) / 2;
int extraStartX = ConsoleWrapper.WindowWidth / 2 - (interiorWidth + 4) / 2;
int extraEndX = Console.WindowWidth / 2 + (interiorWidth + 4) / 2;
int extraEndX = ConsoleWrapper.WindowWidth / 2 + (interiorWidth + 4) / 2;
int startY = 1;
int endY = bootPrompt + startY - 2;
builder.Append(
Expand All @@ -70,7 +70,7 @@ public override string Render()