mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Add MaxWidth property to Text and set in Window title rendering
This commit is contained in:
@@ -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<RenderCommand> ToPrimitives(int windowId)
|
||||
{
|
||||
yield return new RenderCommand
|
||||
@@ -37,6 +43,7 @@ public class Text() : UIElement("Text")
|
||||
["Color"] = Color,
|
||||
["Content"] = Content,
|
||||
["FontSize"] = FontSize,
|
||||
["MaxWidth"] = MaxWidth,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user