style<Histories, DiffViewer>: text render options

This commit is contained in:
leo 2021-07-30 12:21:11 +08:00
parent 22249876b5
commit f5bc2937ed
2 changed files with 3 additions and 2 deletions

View file

@ -468,12 +468,13 @@ namespace SourceGit.Views.Widgets {
line.SetBinding(TextBlock.ForegroundProperty, new Binding("FG")); line.SetBinding(TextBlock.ForegroundProperty, new Binding("FG"));
line.SetBinding(TextBlock.FontStyleProperty, new Binding("Style")); line.SetBinding(TextBlock.FontStyleProperty, new Binding("Style"));
line.SetValue(TextBlock.FontFamilyProperty, new FontFamily("Consolas,Microsoft YaHei UI")); line.SetValue(TextBlock.FontFamilyProperty, new FontFamily("Consolas,Microsoft YaHei UI"));
line.SetValue(TextBlock.FontSizeProperty, new FontSizeConverter().ConvertFrom("9pt")); line.SetValue(TextBlock.FontSizeProperty, 13.0);
line.SetValue(TextBlock.MarginProperty, new Thickness(0)); line.SetValue(TextBlock.MarginProperty, new Thickness(0));
line.SetValue(TextBlock.PaddingProperty, new Thickness(4, 0, 0, 0)); line.SetValue(TextBlock.PaddingProperty, new Thickness(4, 0, 0, 0));
line.SetValue(TextBlock.LineHeightProperty, 16.0); line.SetValue(TextBlock.LineHeightProperty, 16.0);
line.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display); line.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
line.SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType); line.SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType);
line.SetValue(RenderOptions.ClearTypeHintProperty, ClearTypeHint.Enabled);
var colContent = new DataGridTemplateColumn(); var colContent = new DataGridTemplateColumn();
colContent.CellTemplate = new DataTemplate(); colContent.CellTemplate = new DataTemplate();

View file

@ -97,7 +97,7 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
<TextBlock Text="{Binding Subject}" FontFamily="Consolas,Microsoft YaHei UI" FontSize="9pt" Margin="2,0,0,0"/> <TextBlock Text="{Binding Subject}" FontFamily="Consolas,Microsoft YaHei UI Light" FontSize="13" RenderOptions.ClearTypeHint="Enabled" Margin="2,0,0,0"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>