Reorganize project structure

This commit is contained in:
Stone_Red
2026-06-19 00:56:46 +02:00
parent 6f58eefb66
commit 95d88f1a8d
84 changed files with 267 additions and 186 deletions
@@ -0,0 +1,70 @@
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.Kernel.UI.GUI.UIEelements.Controls;
public class ProgressBar() : Control("ProgressBar")
{
public int Value
{
get;
set => SetProperty(nameof(Value), ref field, value);
}
public Color FillColor
{
get;
set => SetProperty(nameof(FillColor), ref field, value);
} = Color.Green;
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
// Background
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = RenderCommandType.DrawFilledRect,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = BackgroundColor,
["Size"] = Size,
}
};
// Fill
int fillWidth = Size.Width * Math.Clamp(Value, 0, 100) / 100;
if (fillWidth > 0)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(1),
Type = RenderCommandType.DrawFilledRect,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = FillColor,
["Size"] = new Size(fillWidth, Size.Height),
}
};
}
// Border
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(2),
Type = RenderCommandType.DrawRectBorder,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color.DarkGray,
["Size"] = Size,
}
};
}
}