mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-02 17:44:59 +00:00
feature<Preference>: add custom font settings
This commit is contained in:
parent
0643f5803c
commit
0c7f217106
29 changed files with 202 additions and 70 deletions
|
@ -7,12 +7,16 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||
xmlns:models="clr-namespace:SourceGit.Models"
|
||||
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ResizeMode="NoResize"
|
||||
Title="{DynamicResource Text.Preference}"
|
||||
Width="500" SizeToContent="Height">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<converters:FontFamiliesToName x:Key="FontFamiliesToName"/>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="1"/>
|
||||
|
@ -58,6 +62,8 @@
|
|||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="8"/>
|
||||
<RowDefinition Height="36"/>
|
||||
<RowDefinition Height="28"/>
|
||||
|
@ -99,14 +105,58 @@
|
|||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"
|
||||
SelectionChanged="LocaleChanged"/>
|
||||
|
||||
<!-- Avatar -->
|
||||
<!-- System Font -->
|
||||
<TextBlock
|
||||
Grid.Row="2" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.FontFamilyWindow}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,6,0"/>
|
||||
<ComboBox
|
||||
Grid.Row="2" Grid.Column="1"
|
||||
Height="24"
|
||||
ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}"
|
||||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyWindow, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}"
|
||||
DisplayMemberPath="Name"
|
||||
SelectedValuePath="Name"
|
||||
SelectionChanged="LocaleChanged">
|
||||
<ComboBox.Resources>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="FontFamily" Value="{Binding Name}"/>
|
||||
<Setter Property="ToolTip" Value="{Binding Name}"/>
|
||||
</Style>
|
||||
</ComboBox.Resources>
|
||||
</ComboBox>
|
||||
|
||||
<!-- Content Font -->
|
||||
<TextBlock
|
||||
Grid.Row="3" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.FontFamilyContent}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,6,0"/>
|
||||
<ComboBox
|
||||
Grid.Row="3" Grid.Column="1"
|
||||
Height="24"
|
||||
ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}"
|
||||
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}"
|
||||
DisplayMemberPath="Name"
|
||||
SelectedValuePath="Name"
|
||||
SelectionChanged="LocaleChanged">
|
||||
<ComboBox.Resources>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="FontFamily" Value="{Binding Name}"/>
|
||||
<Setter Property="ToolTip" Value="{Binding Name}"/>
|
||||
</Style>
|
||||
</ComboBox.Resources>
|
||||
</ComboBox>
|
||||
|
||||
<!-- Avatar -->
|
||||
<TextBlock
|
||||
Grid.Row="4" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.AvatarServer}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<ComboBox
|
||||
Grid.Row="2" Grid.Column="1"
|
||||
Grid.Row="4" Grid.Column="1"
|
||||
Height="24"
|
||||
ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
|
||||
DisplayMemberPath="Name"
|
||||
|
@ -115,36 +165,36 @@
|
|||
|
||||
<!-- Enable Check For Update -->
|
||||
<CheckBox
|
||||
Grid.Row="3" Grid.Column="1"
|
||||
Grid.Row="5" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Preference.CheckUpdate}"
|
||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
|
||||
|
||||
<!-- Auto Fetch -->
|
||||
<CheckBox
|
||||
Grid.Row="4" Grid.Column="1"
|
||||
Grid.Row="6" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Preference.AutoFetch}"
|
||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/>
|
||||
|
||||
<!-- Restore Windows -->
|
||||
<CheckBox
|
||||
Grid.Row="5" Grid.Column="1"
|
||||
Grid.Row="7" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Preference.RestoreTabs}"
|
||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/>
|
||||
|
||||
<!-- Git Group -->
|
||||
<TextBlock
|
||||
Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Text="{DynamicResource Text.Preference.Git}"
|
||||
FontSize="16" FontWeight="DemiBold"
|
||||
Foreground="{DynamicResource Brush.FG2}"/>
|
||||
|
||||
<!-- Git Executable Path -->
|
||||
<TextBlock
|
||||
Grid.Row="8" Grid.Column="0"
|
||||
Grid.Row="10" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Git.Path}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<Grid Grid.Row="8" Grid.Column="1">
|
||||
<Grid Grid.Row="10" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
@ -167,11 +217,11 @@
|
|||
|
||||
<!-- Default Clone Dir -->
|
||||
<TextBlock
|
||||
Grid.Row="9" Grid.Column="0"
|
||||
Grid.Row="11" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Git.Dir}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<Grid Grid.Row="9" Grid.Column="1">
|
||||
<Grid Grid.Row="11" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
@ -194,36 +244,36 @@
|
|||
|
||||
<!-- User -->
|
||||
<TextBlock
|
||||
Grid.Row="10" Grid.Column="0"
|
||||
Grid.Row="12" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Git.User}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<controls:TextEdit
|
||||
Grid.Row="10" Grid.Column="1"
|
||||
Grid.Row="12" Grid.Column="1"
|
||||
Height="24"
|
||||
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
|
||||
Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/>
|
||||
|
||||
<!-- Email -->
|
||||
<TextBlock
|
||||
Grid.Row="11" Grid.Column="0"
|
||||
Grid.Row="13" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Git.Email}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<controls:TextEdit
|
||||
Grid.Row="11" Grid.Column="1"
|
||||
Grid.Row="13" Grid.Column="1"
|
||||
Height="24"
|
||||
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
|
||||
Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/>
|
||||
|
||||
<!-- CRLF -->
|
||||
<TextBlock
|
||||
Grid.Row="12" Grid.Column="0"
|
||||
Grid.Row="14" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Git.CRLF}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<ComboBox
|
||||
Grid.Row="12" Grid.Column="1"
|
||||
Grid.Row="14" Grid.Column="1"
|
||||
Height="24"
|
||||
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
|
||||
SelectedValuePath="Value"
|
||||
|
@ -232,7 +282,7 @@
|
|||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Height="20">
|
||||
<TextBlock Text="{Binding Display}" Margin="2,0"/>
|
||||
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontFamily="Microsoft YaHei UI" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
|
@ -240,19 +290,19 @@
|
|||
|
||||
<!-- Merge Tool Group -->
|
||||
<TextBlock
|
||||
Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Text="{DynamicResource Text.Preference.Merger}"
|
||||
FontSize="16" FontWeight="DemiBold"
|
||||
Foreground="{DynamicResource Brush.FG2}"/>
|
||||
|
||||
<!-- Merge Tool Type -->
|
||||
<TextBlock
|
||||
Grid.Row="15" Grid.Column="0"
|
||||
Grid.Row="17" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Merger.Type}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<ComboBox
|
||||
Grid.Row="15" Grid.Column="1"
|
||||
Grid.Row="17" Grid.Column="1"
|
||||
Height="24"
|
||||
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
|
||||
DisplayMemberPath="Name"
|
||||
|
@ -262,11 +312,11 @@
|
|||
|
||||
<!-- Merge Tool Executable Path -->
|
||||
<TextBlock
|
||||
Grid.Row="16" Grid.Column="0"
|
||||
Grid.Row="18" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.Merger.Path}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,8,0"/>
|
||||
<Grid Grid.Row="16" Grid.Column="1">
|
||||
<Grid Grid.Row="18" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue