From 92cc387f2d9fc9b5c57ad2d830d3cbf8fc30732a Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Tue, 16 Jun 2026 19:25:04 +0200 Subject: [PATCH] Add taskbar, start menu, and desktop background with gradient bands --- Processes/DesktopProcess.cs | 290 ++++++++++++++----------- UI/GUI/Rendering/CanvasRenderSource.cs | 19 +- UI/GUI/Windows/Window.cs | 8 +- UI/GUI/Windows/WindowManager.cs | 14 ++ 4 files changed, 204 insertions(+), 127 deletions(-) diff --git a/Processes/DesktopProcess.cs b/Processes/DesktopProcess.cs index 1b3d193..e5b3ac9 100644 --- a/Processes/DesktopProcess.cs +++ b/Processes/DesktopProcess.cs @@ -1,3 +1,5 @@ +using Cosmos.Kernel.System.Graphics; + using RemSox.Processing; using RemSox.UI.GUI.Layout; using RemSox.UI.GUI.Rendering; @@ -12,6 +14,19 @@ internal class DesktopProcess() : Process("Desktop Manager") { private static bool isGraphicsInitialized = false; + private static readonly (string Name, Func Spawn)[] AvailableApps = [ + ("Terminal", () => ProcessManager.SpawnProcess()), + ("Test Process",() => ProcessManager.SpawnProcess()), + ("YesNt", () => ProcessManager.SpawnProcess()), + ]; + + private Window taskbar = null!; + private Window? startMenu; + private Button startButton = null!; + + private readonly List<(int WindowId, Button Button)> windowButtons = []; + private int tickCount; + internal override void Start(string[] args) { if (!isGraphicsInitialized) @@ -21,141 +36,82 @@ internal class DesktopProcess() : Process("Desktop Manager") } WindowManager.InvalidateAll(); + CreateTaskbar(); + } - // Test window 1: interactive controls using stack layout - Window testWindow = WindowManager.CreateWindow(this, "UI Controls", new Size(280, 260)); - testWindow.AutoFlush = true; + private void CreateTaskbar() + { + Canvas canvas = FullScreenCanvas.GetFullScreenCanvas(); + int screenW = (int)canvas.Mode.Width; + int screenH = (int)canvas.Mode.Height; + const int taskbarH = 36; - StackLayout stack = testWindow.CreateStackLayout(20, 30, 6); - stack.UniformWidth = 240; + taskbar = WindowManager.CreateWindow(this, "Taskbar", + new Size(screenW, taskbarH), + new Point(0, screenH - taskbarH)); + taskbar.HasChrome = false; + taskbar.IsResizable = false; + taskbar.IsDraggable = false; + taskbar.ZIndex = int.MaxValue; + taskbar.AutoFlush = true; - Button button = stack.Add