style<Preference>: new style of preference setting dialog

This commit is contained in:
leo 2021-10-13 11:19:45 +08:00
parent e32df7d461
commit e5996d0fe1
5 changed files with 314 additions and 310 deletions

View file

@ -45,7 +45,7 @@ namespace SourceGit.Commands {
private Timer timer = null; private Timer timer = null;
public static void Start(string repo) { public static void Start(string repo) {
if (!Models.Preference.Instance.General.AutoFetchRemotes) return; if (!Models.Preference.Instance.Git.AutoFetchRemotes) return;
// 只自动更新加入管理列表中的仓库(子模块等不自动更新) // 只自动更新加入管理列表中的仓库(子模块等不自动更新)
var exists = Models.Preference.Instance.FindRepository(repo); var exists = Models.Preference.Instance.FindRepository(repo);

View file

@ -68,11 +68,6 @@ namespace SourceGit.Models {
/// </summary> /// </summary>
public int LastCheckDay { get; set; } = 0; public int LastCheckDay { get; set; } = 0;
/// <summary>
/// 启用自动拉取远程变更每10分钟一次
/// </summary>
public bool AutoFetchRemotes { get; set; } = true;
/// <summary> /// <summary>
/// 是否启用崩溃上报 /// 是否启用崩溃上报
/// </summary> /// </summary>
@ -98,6 +93,11 @@ namespace SourceGit.Models {
/// 默认克隆路径 /// 默认克隆路径
/// </summary> /// </summary>
public string DefaultCloneDir { get; set; } public string DefaultCloneDir { get; set; }
/// <summary>
/// 启用自动拉取远程变更每10分钟一次
/// </summary>
public bool AutoFetchRemotes { get; set; } = true;
} }
/// <summary> /// <summary>

View file

@ -359,18 +359,17 @@
<sys:String x:Key="Text.Revert.CommitChanges">Commit revert changes</sys:String> <sys:String x:Key="Text.Revert.CommitChanges">Commit revert changes</sys:String>
<sys:String x:Key="Text.Preference">Preference</sys:String> <sys:String x:Key="Text.Preference">Preference</sys:String>
<sys:String x:Key="Text.Preference.General">GENERAL SETTING</sys:String> <sys:String x:Key="Text.Preference.General">GENERAL</sys:String>
<sys:String x:Key="Text.Preference.Locale">Language</sys:String> <sys:String x:Key="Text.Preference.Locale">Language</sys:String>
<sys:String x:Key="Text.Preference.FontFamilyWindow">Window Font</sys:String> <sys:String x:Key="Text.Preference.FontFamilyWindow">Window Font</sys:String>
<sys:String x:Key="Text.Preference.FontFamilyContent">Content Font</sys:String> <sys:String x:Key="Text.Preference.FontFamilyContent">Content Font</sys:String>
<sys:String x:Key="Text.Preference.AvatarServer">Avatar Server</sys:String> <sys:String x:Key="Text.Preference.AvatarServer">Avatar Server</sys:String>
<sys:String x:Key="Text.Preference.CheckUpdate">Check for update</sys:String> <sys:String x:Key="Text.Preference.CheckUpdate">Check for update</sys:String>
<sys:String x:Key="Text.Preference.UseDarkTheme">Use dark theme</sys:String> <sys:String x:Key="Text.Preference.UseDarkTheme">Use dark theme</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">Fetch remotes automatically (need restart)</sys:String>
<sys:String x:Key="Text.Preference.RestoreTabs">Restore windows</sys:String> <sys:String x:Key="Text.Preference.RestoreTabs">Restore windows</sys:String>
<sys:String x:Key="Text.Preference.EnableCrashReport">Enable crash report (maybe include related path)</sys:String> <sys:String x:Key="Text.Preference.EnableCrashReport">Enable crash report (maybe include related path)</sys:String>
<sys:String x:Key="Text.Preference.UseWindowsTerminal">Use Windows Terminal instead of cmd.exe</sys:String> <sys:String x:Key="Text.Preference.UseWindowsTerminal">Use Windows Terminal instead of cmd.exe</sys:String>
<sys:String x:Key="Text.Preference.Git">GIT SETTING</sys:String> <sys:String x:Key="Text.Preference.Git">GIT</sys:String>
<sys:String x:Key="Text.Preference.Git.Path">Install Path</sys:String> <sys:String x:Key="Text.Preference.Git.Path">Install Path</sys:String>
<sys:String x:Key="Text.Preference.Git.Path.Placeholder">Input path for git.exe</sys:String> <sys:String x:Key="Text.Preference.Git.Path.Placeholder">Input path for git.exe</sys:String>
<sys:String x:Key="Text.Preference.Git.Version">Git version</sys:String> <sys:String x:Key="Text.Preference.Git.Version">Git version</sys:String>
@ -381,7 +380,8 @@
<sys:String x:Key="Text.Preference.Git.Email">User Email</sys:String> <sys:String x:Key="Text.Preference.Git.Email">User Email</sys:String>
<sys:String x:Key="Text.Preference.Git.Email.Placeholder">Global git user email</sys:String> <sys:String x:Key="Text.Preference.Git.Email.Placeholder">Global git user email</sys:String>
<sys:String x:Key="Text.Preference.Git.CRLF">Enable Auto CRLF</sys:String> <sys:String x:Key="Text.Preference.Git.CRLF">Enable Auto CRLF</sys:String>
<sys:String x:Key="Text.Preference.Merger">MERGE TOOL</sys:String> <sys:String x:Key="Text.Preference.Git.AutoFetch">Fetch remotes automatically (need restart)</sys:String>
<sys:String x:Key="Text.Preference.Merger">MERGE</sys:String>
<sys:String x:Key="Text.Preference.Merger.Type">Merger</sys:String> <sys:String x:Key="Text.Preference.Merger.Type">Merger</sys:String>
<sys:String x:Key="Text.Preference.Merger.Path">Install Path</sys:String> <sys:String x:Key="Text.Preference.Merger.Path">Install Path</sys:String>
<sys:String x:Key="Text.Preference.Merger.Path.Placeholder">Input path for merge tool</sys:String> <sys:String x:Key="Text.Preference.Merger.Path.Placeholder">Input path for merge tool</sys:String>

View file

@ -365,7 +365,6 @@
<sys:String x:Key="Text.Preference.AvatarServer">头像服务</sys:String> <sys:String x:Key="Text.Preference.AvatarServer">头像服务</sys:String>
<sys:String x:Key="Text.Preference.CheckUpdate">启用检测更新</sys:String> <sys:String x:Key="Text.Preference.CheckUpdate">启用检测更新</sys:String>
<sys:String x:Key="Text.Preference.UseDarkTheme">启用暗色主题</sys:String> <sys:String x:Key="Text.Preference.UseDarkTheme">启用暗色主题</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">启用定时自动拉取远程更新(重启生效)</sys:String>
<sys:String x:Key="Text.Preference.RestoreTabs">启动时恢复上次打开的仓库</sys:String> <sys:String x:Key="Text.Preference.RestoreTabs">启动时恢复上次打开的仓库</sys:String>
<sys:String x:Key="Text.Preference.EnableCrashReport">开启崩溃上报(可能涉及上报相关路径)</sys:String> <sys:String x:Key="Text.Preference.EnableCrashReport">开启崩溃上报(可能涉及上报相关路径)</sys:String>
<sys:String x:Key="Text.Preference.UseWindowsTerminal">使用 Windows Terminal 打开 Git 终端</sys:String> <sys:String x:Key="Text.Preference.UseWindowsTerminal">使用 Windows Terminal 打开 Git 终端</sys:String>
@ -380,6 +379,7 @@
<sys:String x:Key="Text.Preference.Git.Email">邮箱</sys:String> <sys:String x:Key="Text.Preference.Git.Email">邮箱</sys:String>
<sys:String x:Key="Text.Preference.Git.Email.Placeholder">默认GIT用户邮箱</sys:String> <sys:String x:Key="Text.Preference.Git.Email.Placeholder">默认GIT用户邮箱</sys:String>
<sys:String x:Key="Text.Preference.Git.CRLF">自动换行转换</sys:String> <sys:String x:Key="Text.Preference.Git.CRLF">自动换行转换</sys:String>
<sys:String x:Key="Text.Preference.Git.AutoFetch">启用定时自动拉取远程更新(重启生效)</sys:String>
<sys:String x:Key="Text.Preference.Merger">外部合并工具</sys:String> <sys:String x:Key="Text.Preference.Merger">外部合并工具</sys:String>
<sys:String x:Key="Text.Preference.Merger.Type">工具</sys:String> <sys:String x:Key="Text.Preference.Merger.Type">工具</sys:String>
<sys:String x:Key="Text.Preference.Merger.Path">安装路径</sys:String> <sys:String x:Key="Text.Preference.Merger.Path">安装路径</sys:String>

View file

@ -12,7 +12,7 @@
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
ResizeMode="NoResize" ResizeMode="NoResize"
Title="{DynamicResource Text.Preference}" Title="{DynamicResource Text.Preference}"
Width="500" SizeToContent="Height"> Width="500" Height="340">
<Grid> <Grid>
<Grid.Resources> <Grid.Resources>
<converters:FontFamiliesToName x:Key="FontFamiliesToName"/> <converters:FontFamiliesToName x:Key="FontFamiliesToName"/>
@ -53,327 +53,331 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Fill="{DynamicResource Brush.Border0}"/> Fill="{DynamicResource Brush.Border0}"/>
<!-- Body --> <!-- Tabs -->
<Grid Grid.Row="2" Margin="16,8"> <TabControl Grid.Row="2" Margin="0,4">
<Grid.RowDefinitions> <!-- General Setting -->
<RowDefinition Height="36"/> <TabItem Header="{DynamicResource Text.Preference.General}">
<RowDefinition Height="28"/> <Grid Margin="0,8">
<RowDefinition Height="28"/> <Grid.RowDefinitions>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="8"/> <RowDefinition Height="28"/>
<RowDefinition Height="36"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> </Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="8"/>
<RowDefinition Height="36"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="6"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="132"/> <ColumnDefinition Width="132"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- General Group --> <!-- Language -->
<TextBlock <TextBlock
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.General}" Text="{DynamicResource Text.Preference.Locale}"
FontSize="16" FontWeight="DemiBold" HorizontalAlignment="Right"
Foreground="{DynamicResource Brush.FG2}"/> Margin="0,0,8,0"/>
<ComboBox
Grid.Row="0" Grid.Column="1"
Height="24"
ItemsSource="{Binding Source={x:Static models:Locale.Supported}}"
DisplayMemberPath="Name"
SelectedValuePath="Resource"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"
SelectionChanged="LocaleChanged"/>
<!-- Language --> <!-- System Font -->
<TextBlock <TextBlock
Grid.Row="1" Grid.Column="0" Grid.Row="1" Grid.Column="0"
Text="{DynamicResource Text.Preference.Locale}" Text="{DynamicResource Text.Preference.FontFamilyWindow}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,6,0"/>
<ComboBox <ComboBox
Grid.Row="1" Grid.Column="1" Grid.Row="1" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:Locale.Supported}}" ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}"
DisplayMemberPath="Name" SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyWindow, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}"
SelectedValuePath="Resource" DisplayMemberPath="Name"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}" SelectedValuePath="Name"
SelectionChanged="LocaleChanged"/> SelectionChanged="LocaleChanged">
<ComboBox.Resources>
<Style TargetType="ComboBoxItem">
<Setter Property="FontFamily" Value="{Binding Name}"/>
<Setter Property="ToolTip" Value="{Binding Name}"/>
</Style>
</ComboBox.Resources>
</ComboBox>
<!-- System Font --> <!-- Content Font -->
<TextBlock <TextBlock
Grid.Row="2" Grid.Column="0" Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.FontFamilyWindow}" Text="{DynamicResource Text.Preference.FontFamilyContent}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,6,0"/> Margin="0,0,6,0"/>
<ComboBox <ComboBox
Grid.Row="2" Grid.Column="1" Grid.Row="2" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}" ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyWindow, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}" SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}"
DisplayMemberPath="Name" DisplayMemberPath="Name"
SelectedValuePath="Name" SelectedValuePath="Name"
SelectionChanged="LocaleChanged"> SelectionChanged="LocaleChanged">
<ComboBox.Resources> <ComboBox.Resources>
<Style TargetType="ComboBoxItem"> <Style TargetType="ComboBoxItem">
<Setter Property="FontFamily" Value="{Binding Name}"/> <Setter Property="FontFamily" Value="{Binding Name}"/>
<Setter Property="ToolTip" Value="{Binding Name}"/> <Setter Property="ToolTip" Value="{Binding Name}"/>
</Style> </Style>
</ComboBox.Resources> </ComboBox.Resources>
</ComboBox> </ComboBox>
<!-- Content Font --> <!-- Avatar -->
<TextBlock <TextBlock
Grid.Row="3" Grid.Column="0" Grid.Row="3" Grid.Column="0"
Text="{DynamicResource Text.Preference.FontFamilyContent}" Text="{DynamicResource Text.Preference.AvatarServer}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,6,0"/> Margin="0,0,8,0"/>
<ComboBox <ComboBox
Grid.Row="3" Grid.Column="1" Grid.Row="3" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:InstalledFont.GetFonts}}" ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=TwoWay, Converter={StaticResource FontFamiliesToName}}" DisplayMemberPath="Name"
DisplayMemberPath="Name" SelectedValuePath="Url"
SelectedValuePath="Name" SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.AvatarServer, Mode=TwoWay}"/>
SelectionChanged="LocaleChanged">
<ComboBox.Resources>
<Style TargetType="ComboBoxItem">
<Setter Property="FontFamily" Value="{Binding Name}"/>
<Setter Property="ToolTip" Value="{Binding Name}"/>
</Style>
</ComboBox.Resources>
</ComboBox>
<!-- Avatar --> <!-- Enable Check For Update -->
<TextBlock <CheckBox
Grid.Row="4" Grid.Column="0" Grid.Row="4" Grid.Column="1"
Text="{DynamicResource Text.Preference.AvatarServer}" Content="{DynamicResource Text.Preference.CheckUpdate}"
HorizontalAlignment="Right" IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
Margin="0,0,8,0"/>
<ComboBox
Grid.Row="4" Grid.Column="1"
Height="24"
ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
DisplayMemberPath="Name"
SelectedValuePath="Url"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.AvatarServer, Mode=TwoWay}"/>
<!-- Enable Check For Update --> <!-- Enable Dark Theme -->
<CheckBox <CheckBox
Grid.Row="5" Grid.Column="1" Grid.Row="5" Grid.Column="1"
Content="{DynamicResource Text.Preference.CheckUpdate}" Content="{DynamicResource Text.Preference.UseDarkTheme}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/> IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}"
Checked="ChangeTheme" Unchecked="ChangeTheme"/>
<!-- Enable Dark Theme --> <!-- Restore Windows -->
<CheckBox <CheckBox
Grid.Row="6" Grid.Column="1" Grid.Row="6" Grid.Column="1"
Content="{DynamicResource Text.Preference.UseDarkTheme}" Content="{DynamicResource Text.Preference.RestoreTabs}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}" IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/>
Checked="ChangeTheme" Unchecked="ChangeTheme"/>
<!-- Auto Fetch --> <!-- Crash Report -->
<CheckBox <CheckBox
Grid.Row="7" Grid.Column="1" Grid.Row="7" Grid.Column="1"
Content="{DynamicResource Text.Preference.AutoFetch}" Content="{DynamicResource Text.Preference.EnableCrashReport}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/> IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.EnableCrashReport, Mode=TwoWay}"/>
<!-- Restore Windows --> <!-- Use Windows Terminal -->
<CheckBox <CheckBox
Grid.Row="8" Grid.Column="1" Grid.Row="8" Grid.Column="1"
Content="{DynamicResource Text.Preference.RestoreTabs}" Content="{DynamicResource Text.Preference.UseWindowsTerminal}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/> IsEnabled="{Binding ElementName=me, Path=HasWindowsTerminal}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseWindowsTerminal, Mode=TwoWay}"/>
</Grid>
</TabItem>
<!-- Crash Report --> <!-- Git Setting -->
<CheckBox <TabItem Header="{DynamicResource Text.Preference.Git}">
Grid.Row="9" Grid.Column="1" <Grid Margin="0,8">
Content="{DynamicResource Text.Preference.EnableCrashReport}" <Grid.RowDefinitions>
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.EnableCrashReport, Mode=TwoWay}"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
</Grid.RowDefinitions>
<!-- Use Windows Terminal --> <Grid.ColumnDefinitions>
<CheckBox <ColumnDefinition Width="132"/>
Grid.Row="10" Grid.Column="1" <ColumnDefinition Width="*"/>
Content="{DynamicResource Text.Preference.UseWindowsTerminal}" </Grid.ColumnDefinitions>
IsEnabled="{Binding ElementName=me, Path=HasWindowsTerminal}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseWindowsTerminal, Mode=TwoWay}"/>
<!-- Git Group --> <!-- Git Executable Path -->
<TextBlock <TextBlock
Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git}" Text="{DynamicResource Text.Preference.Git.Path}"
FontSize="16" FontWeight="DemiBold" HorizontalAlignment="Right"
Foreground="{DynamicResource Brush.FG2}"/> Margin="0,0,8,0"/>
<Grid Grid.Row="0" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Git Executable Path --> <controls:TextEdit
<TextBlock Grid.Column="0"
Grid.Row="13" Grid.Column="0" x:Name="editGitPath"
Text="{DynamicResource Text.Preference.Git.Path}" Height="24"
HorizontalAlignment="Right" Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.Path, Mode=TwoWay}"
Margin="0,0,8,0"/> Placeholder="{DynamicResource Text.Preference.Git.Path.Placeholder}"/>
<Grid Grid.Row="13" Grid.Column="1"> <controls:IconButton
<Grid.ColumnDefinitions> Grid.Column="1"
<ColumnDefinition Width="*"/> Click="SelectGitPath"
<ColumnDefinition Width="Auto"/> Width="24" Height="24"
</Grid.ColumnDefinitions> Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<controls:TextEdit <!-- Git Version -->
Grid.Column="0" <TextBlock
x:Name="editGitPath" Grid.Row="1" Grid.Column="0"
Height="24" Text="{DynamicResource Text.Preference.Git.Version}"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.Path, Mode=TwoWay}" HorizontalAlignment="Right"
Placeholder="{DynamicResource Text.Preference.Git.Path.Placeholder}"/> Margin="0,0,8,0"/>
<controls:IconButton <TextBlock
Grid.Column="1" Grid.Row="1" Grid.Column="1"
Click="SelectGitPath" x:Name="textGitVersion"
Width="24" Height="24" Text="{Binding ElementName=me, Path=Version}"/>
Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<!-- Git Version --> <!-- Default Clone Dir -->
<TextBlock <TextBlock
Grid.Row="14" Grid.Column="0" Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Version}" Text="{DynamicResource Text.Preference.Git.Dir}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<TextBlock <Grid Grid.Row="2" Grid.Column="1">
Grid.Row="14" Grid.Column="1" <Grid.ColumnDefinitions>
x:Name="textGitVersion" <ColumnDefinition Width="*"/>
Text="{Binding ElementName=me, Path=Version}"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Default Clone Dir --> <controls:TextEdit
<TextBlock Grid.Column="0"
Grid.Row="15" Grid.Column="0" x:Name="txtGitCloneDir"
Text="{DynamicResource Text.Preference.Git.Dir}" Height="24"
HorizontalAlignment="Right" Placeholder="{DynamicResource Text.Preference.Git.Dir.Placeholder}"
Margin="0,0,8,0"/> Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.DefaultCloneDir, Mode=TwoWay}"/>
<Grid Grid.Row="15" Grid.Column="1"> <controls:IconButton
<Grid.ColumnDefinitions> Grid.Column="1"
<ColumnDefinition Width="*"/> Click="SelectGitCloneDir"
<ColumnDefinition Width="Auto"/> Width="24" Height="24"
</Grid.ColumnDefinitions> Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<controls:TextEdit <!-- User -->
Grid.Column="0" <TextBlock
x:Name="txtGitCloneDir" Grid.Row="3" Grid.Column="0"
Height="24" Text="{DynamicResource Text.Preference.Git.User}"
Placeholder="{DynamicResource Text.Preference.Git.Dir.Placeholder}" HorizontalAlignment="Right"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.DefaultCloneDir, Mode=TwoWay}"/> Margin="0,0,8,0"/>
<controls:IconButton <controls:TextEdit
Grid.Column="1" Grid.Row="3" Grid.Column="1"
Click="SelectGitCloneDir" x:Name="editGitUser"
Width="24" Height="24" Height="24"
Margin="4,0,0,0" Padding="4" Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}" Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/>
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<!-- User --> <!-- Email -->
<TextBlock <TextBlock
Grid.Row="16" Grid.Column="0" Grid.Row="4" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.User}" Text="{DynamicResource Text.Preference.Git.Email}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<controls:TextEdit <controls:TextEdit
Grid.Row="16" Grid.Column="1" Grid.Row="4" Grid.Column="1"
x:Name="editGitUser" x:Name="editGitEmail"
Height="24" Height="24"
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}" Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/> Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/>
<!-- Email --> <!-- CRLF -->
<TextBlock <TextBlock
Grid.Row="17" Grid.Column="0" Grid.Row="5" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Email}" Text="{DynamicResource Text.Preference.Git.CRLF}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<controls:TextEdit <ComboBox
Grid.Row="17" Grid.Column="1" Grid.Row="5" Grid.Column="1"
x:Name="editGitEmail" x:Name="editGitCrlf"
Height="24" Height="24"
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}" ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/> SelectedValuePath="Value"
SelectedValue="{Binding ElementName=me, Path=CRLF, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Display}" Margin="2,0"/>
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- CRLF --> <!-- Auto Fetch -->
<TextBlock <CheckBox
Grid.Row="18" Grid.Column="0" Grid.Row="6" Grid.Column="1"
Text="{DynamicResource Text.Preference.Git.CRLF}" Content="{DynamicResource Text.Preference.Git.AutoFetch}"
HorizontalAlignment="Right" IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Git.AutoFetchRemotes, Mode=TwoWay}"/>
Margin="0,0,8,0"/> </Grid>
<ComboBox </TabItem>
Grid.Row="18" Grid.Column="1"
x:Name="editGitCrlf"
Height="24"
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
SelectedValuePath="Value"
SelectedValue="{Binding ElementName=me, Path=CRLF, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Display}" Margin="2,0"/>
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Merge Tool Group --> <TabItem Header="{DynamicResource Text.Preference.Merger}">
<TextBlock <Grid Margin="0,8">
Grid.Row="20" Grid.Column="0" Grid.ColumnSpan="2" <Grid.RowDefinitions>
Text="{DynamicResource Text.Preference.Merger}" <RowDefinition Height="28"/>
FontSize="17" FontWeight="DemiBold" <RowDefinition Height="28"/>
Foreground="{DynamicResource Brush.FG2}"/> </Grid.RowDefinitions>
<!-- Merge Tool Type --> <Grid.ColumnDefinitions>
<TextBlock <ColumnDefinition Width="132"/>
Grid.Row="21" Grid.Column="0" <ColumnDefinition Width="*"/>
Text="{DynamicResource Text.Preference.Merger.Type}" </Grid.ColumnDefinitions>
HorizontalAlignment="Right"
Margin="0,0,8,0"/>
<ComboBox
Grid.Row="21" Grid.Column="1"
Height="24"
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
DisplayMemberPath="Name"
SelectedValuePath="Type"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Type, Mode=TwoWay}"
SelectionChanged="MergeToolChanged"/>
<!-- Merge Tool Executable Path --> <!-- Merge Tool Type -->
<TextBlock <TextBlock
Grid.Row="22" Grid.Column="0" Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Path}" Text="{DynamicResource Text.Preference.Merger.Type}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<Grid Grid.Row="22" Grid.Column="1"> <ComboBox
<Grid.ColumnDefinitions> Grid.Row="0" Grid.Column="1"
<ColumnDefinition Width="*"/> Height="24"
<ColumnDefinition Width="Auto"/> ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
</Grid.ColumnDefinitions> DisplayMemberPath="Name"
SelectedValuePath="Type"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Type, Mode=TwoWay}"
SelectionChanged="MergeToolChanged"/>
<controls:TextEdit <!-- Merge Tool Executable Path -->
Grid.Column="0" <TextBlock
Height="24" Grid.Row="1" Grid.Column="0"
x:Name="txtMergeExec" Text="{DynamicResource Text.Preference.Merger.Path}"
Placeholder="{DynamicResource Text.Preference.Merger.Path.Placeholder}" HorizontalAlignment="Right"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Path, Mode=TwoWay}"/> Margin="0,0,8,0"/>
<controls:IconButton <Grid Grid.Row="1" Grid.Column="1">
Grid.Column="1" <Grid.ColumnDefinitions>
Click="SelectMergeTool" <ColumnDefinition Width="*"/>
Width="24" Height="24" <ColumnDefinition Width="Auto"/>
Margin="4,0,0,0" Padding="4" </Grid.ColumnDefinitions>
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/> <controls:TextEdit
</Grid> Grid.Column="0"
</Grid> Height="24"
x:Name="txtMergeExec"
Placeholder="{DynamicResource Text.Preference.Merger.Path.Placeholder}"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Path, Mode=TwoWay}"/>
<controls:IconButton
Grid.Column="1"
Click="SelectMergeTool"
Width="24" Height="24"
Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
</Grid>
</TabItem>
</TabControl>
</Grid> </Grid>
</controls:Window> </controls:Window>