feature: allow customized font size

This commit is contained in:
leo 2024-03-22 12:03:04 +08:00
parent 7ba7e58c9f
commit c247b03223
23 changed files with 137 additions and 87 deletions

View file

@ -2265,6 +2265,15 @@ namespace SourceGit.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Default Font Size.
/// </summary>
public static string Text_Preference_General_DefaultFontSize {
get {
return ResourceManager.GetString("Text.Preference.General.DefaultFontSize", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Language.
/// </summary>

View file

@ -1296,4 +1296,7 @@
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<value>Monospace FontFamily</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<value>Default Font Size</value>
</data>
</root>

View file

@ -1296,4 +1296,7 @@
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<value>Monospace FontFamily</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<value>Default Font Size</value>
</data>
</root>

View file

@ -1296,4 +1296,7 @@
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<value>等宽字体</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<value>默认字体大小</value>
</data>
</root>

View file

@ -17,6 +17,7 @@
<Style Selector="ContentPresenter">
<Setter Property="FontFamily" Value="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFont}"/>
<Setter Property="FontSize" Value="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize}"/>
</Style>
<Style Selector="Path">
@ -58,7 +59,6 @@
</Style>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
@ -74,13 +74,11 @@
</Style>
<Style Selector="TextBlock.group_header_label">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="8,0,0,0"/>
</Style>
<Style Selector="TextBlock.info_label">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
@ -103,7 +101,6 @@
</Style>
<Style Selector="TextBox">
<Setter Property="FontSize" Value="13"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="Padding" Value="4,0"/>
<Setter Property="MinHeight" Value="16"/>
@ -452,8 +449,7 @@
Margin="0 5 0 0"
Grid.Column="2"
Grid.Row="2">
<TextBlock Name="PART_MessageContent"
FontSize="11" />
<TextBlock Name="PART_MessageContent" FontSize="11" />
</StackPanel>
</Grid>
</Border>
@ -588,7 +584,6 @@
<Setter Property="Height" Value="26"/>
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}" />
<Setter Property="TextElement.FontSize" Value="12"/>
<Setter Property="Template">
<ControlTemplate>
<Panel>
@ -729,7 +724,6 @@
<SolidColorBrush x:Key="ComboBoxDropDownBorderBrush" Color="{DynamicResource Color.Accent1}"/>
</Style.Resources>
<Setter Property="TextElement.FontSize" Value="13"/>
<Setter Property="MinHeight" Value="20"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border1}"/>