Add automatic window positioning to avoid overlap and maximize spaciousness

This commit is contained in:
Stone_Red
2026-06-10 04:02:54 +02:00
parent 3a635e85df
commit fad05a3e9a
5 changed files with 124 additions and 23 deletions
+11 -7
View File
@@ -9,7 +9,7 @@ using System.Drawing;
namespace RemSox.Processes;
public class TerminalProcess : Process
public class TerminalProcess() : Process("Terminal")
{
private Window window = null!;
private readonly List<string> history = [];
@@ -19,13 +19,9 @@ public class TerminalProcess : Process
private const int LineHeight = 30;
private Size lastSize = new(-1, -1);
public TerminalProcess() : base("Terminal")
{
}
internal override void Start(string[] args)
{
window = WindowManager.CreateWindow(this, "Terminal", new Point(50, 50), new Size(400, 300));
window = WindowManager.CreateWindow(this, "Terminal", new Size(400, 300));
PrintLine("RemSox GUI Terminal v1.0");
PrintLine("Type 'help' for commands.");
@@ -58,10 +54,18 @@ public class TerminalProcess : Process
if (!string.IsNullOrWhiteSpace(cmd))
{
if (cmd == "exit")
if (cmd.Trim() == "exit")
{
RequestStop();
}
else if (cmd.Trim() == "clear")
{
lock (textLinesLock)
{
history.Clear();
UpdateDisplay();
}
}
else
{
bool found = CommandManager.TryExecute(cmd, PrintLine);