From f049a43dfd481965498531ec656743ae4b8bb662 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Tue, 16 Jun 2026 20:03:19 +0200 Subject: [PATCH] Add MaxWidth property to Text and set in Window title rendering --- UI/GUI/UIEelements/Shapes/Text.cs | 7 +++++++ UI/GUI/Windows/Window.cs | 1 + 2 files changed, 8 insertions(+) diff --git a/UI/GUI/UIEelements/Shapes/Text.cs b/UI/GUI/UIEelements/Shapes/Text.cs index f6e50fe..bdd80d6 100644 --- a/UI/GUI/UIEelements/Shapes/Text.cs +++ b/UI/GUI/UIEelements/Shapes/Text.cs @@ -24,6 +24,12 @@ public class Text() : UIElement("Text") set => SetProperty(nameof(FontSize), ref field, value); } = 12; + public int MaxWidth + { + get; + set => SetProperty(nameof(MaxWidth), ref field, value); + } = int.MaxValue; + public override IEnumerable ToPrimitives(int windowId) { yield return new RenderCommand @@ -37,6 +43,7 @@ public class Text() : UIElement("Text") ["Color"] = Color, ["Content"] = Content, ["FontSize"] = FontSize, + ["MaxWidth"] = MaxWidth, } }; } diff --git a/UI/GUI/Windows/Window.cs b/UI/GUI/Windows/Window.cs index 9d62e8a..f20f5a7 100644 --- a/UI/GUI/Windows/Window.cs +++ b/UI/GUI/Windows/Window.cs @@ -324,6 +324,7 @@ public sealed class Window(string title, int processId, int id, IRenderSource re ["Color"] = Color.White, ["Content"] = Title, ["FontSize"] = 18, + ["MaxWidth"] = Size.Width - 8, } }); }