refactor: Replace TextBlock creation with McColorParser for improved text rendering in chat display

This commit is contained in:
BruceChen 2026-04-06 00:29:27 +08:00
parent a40188cb09
commit b083336bf6

View file

@ -184,14 +184,7 @@ namespace MinecraftClient.Tui
ItemsSource = chatLines,
Focusable = false,
ItemTemplate = new FuncDataTemplate<string>((s, _) =>
new TextBlock
{
Text = s,
Foreground = Brushes.Gray,
Padding = new Thickness(0),
Margin = new Thickness(0),
TextWrapping = TextWrapping.Wrap,
}),
McColorParser.CreateColoredTextBlock(s ?? "", TextWrapping.Wrap)),
};
_chatScrollViewer = new ScrollViewer
{