mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
修复点bug
This commit is contained in:
@@ -1 +1 @@
|
|||||||
907cede
|
03b136f
|
||||||
@@ -309,10 +309,7 @@ namespace CMLeonOS
|
|||||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||||
global::System.Console.Clear();
|
global::System.Console.Clear();
|
||||||
|
|
||||||
var titleBar = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(0, 0, 80, 3), "First Time Setup", () => { }, false);
|
var termsBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 18), "User Terms and Conditions", () => { }, true);
|
||||||
titleBar.Render();
|
|
||||||
|
|
||||||
var termsBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 18), "User Terms and Conditions", () => { }, true);
|
|
||||||
termsBox.Render();
|
termsBox.Render();
|
||||||
|
|
||||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black);
|
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black);
|
||||||
@@ -371,7 +368,6 @@ namespace CMLeonOS
|
|||||||
}
|
}
|
||||||
|
|
||||||
global::System.Console.Clear();
|
global::System.Console.Clear();
|
||||||
titleBar.Render();
|
|
||||||
|
|
||||||
var setupBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 12), "Admin Account Setup", () => { }, true);
|
var setupBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 12), "Admin Account Setup", () => { }, true);
|
||||||
setupBox.Render();
|
setupBox.Render();
|
||||||
@@ -447,9 +443,7 @@ namespace CMLeonOS
|
|||||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||||
global::System.Console.SetCursorPosition(7, 24);
|
global::System.Console.SetCursorPosition(7, 24);
|
||||||
global::System.Console.Write("Admin user created successfully! ");
|
global::System.Console.Write("Admin user created successfully! ");
|
||||||
|
|
||||||
global::System.Console.Clear();
|
global::System.Console.Clear();
|
||||||
titleBar.Render();
|
|
||||||
|
|
||||||
var hostnameBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 8), "Hostname Setup", () => { }, true);
|
var hostnameBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 8), "Hostname Setup", () => { }, true);
|
||||||
hostnameBox.Render();
|
hostnameBox.Render();
|
||||||
@@ -528,9 +522,6 @@ namespace CMLeonOS
|
|||||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||||
global::System.Console.Clear();
|
global::System.Console.Clear();
|
||||||
|
|
||||||
var titleBar = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(0, 0, 80, 3), "System Login", () => { }, false);
|
|
||||||
titleBar.Render();
|
|
||||||
|
|
||||||
var loginBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(15, 8, 50, 10), "Login", () => { }, true);
|
var loginBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(15, 8, 50, 10), "Login", () => { }, true);
|
||||||
loginBox.Render();
|
loginBox.Render();
|
||||||
|
|
||||||
|
|||||||
16
UI/TUI.cs
16
UI/TUI.cs
@@ -156,9 +156,23 @@ namespace CMLeonOS.UI
|
|||||||
if (y == rect.Top)
|
if (y == rect.Top)
|
||||||
{
|
{
|
||||||
Console.Write(corner);
|
Console.Write(corner);
|
||||||
|
|
||||||
|
// Calculate title position
|
||||||
|
int titleX = rect.Left + (rect.Width - title.Length) / 2;
|
||||||
|
int titleStart = titleX;
|
||||||
|
int titleEnd = titleX + title.Length;
|
||||||
|
|
||||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||||
{
|
{
|
||||||
Console.Write(horizontal);
|
// Skip drawing horizontal characters where title will be
|
||||||
|
if (!string.IsNullOrEmpty(title) && x >= titleStart && x < titleEnd)
|
||||||
|
{
|
||||||
|
Console.Write(' ');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.Write(horizontal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Console.Write(corner);
|
Console.Write(corner);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user