Merge pull request !18 from Jai/feature/configure-font

This commit is contained in:
leo 2021-08-11 02:17:10 +00:00 committed by Gitee
commit 7a06756fe9
29 changed files with 202 additions and 70 deletions

View file

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows.Markup;
using System.Windows.Media;
namespace SourceGit.Models {
public class InstalledFont {
public string Name { get; set; }
public int FamilyIndex { get; set; }
public static List<InstalledFont> GetFonts {
get {
var fontList = new List<InstalledFont>();
var fontCollection = Fonts.SystemFontFamilies;
var familyCount = fontCollection.Count;
for (int i = 0; i < familyCount; i++) {
var fontFamily = fontCollection.ElementAt(i);
var familyNames = fontFamily.FamilyNames;
if (!familyNames.TryGetValue(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name), out var name)) {
if (!familyNames.TryGetValue(XmlLanguage.GetLanguage("en-us"), out name)) {
name = familyNames.FirstOrDefault().Value;
}
}
fontList.Add(new InstalledFont() {
Name = name,
FamilyIndex = i
});
}
fontList.Sort((p, n) => string.Compare(p.Name, n.Name, StringComparison.Ordinal));
return fontList;
}
}
}
}

View file

@ -27,6 +27,27 @@ namespace SourceGit.Models {
/// </summary> /// </summary>
public string Locale { get; set; } = "en_US"; public string Locale { get; set; } = "en_US";
/// <summary>
/// 系统字体
/// </summary>
public string FontFamilyWindowSetting { get; set; } = "Microsoft YaHei UI";
[JsonIgnore]
public string FontFamilyWindow {
get => FontFamilyWindowSetting + ",Microsoft YaHei UI";
set => FontFamilyWindowSetting = value;
}
/// <summary>
/// 用户字体(提交列表、提交日志、差异比较等)
/// </summary>
public string FontFamilyContentSetting { get; set; } = "Consolas";
[JsonIgnore] public string FontFamilyContent {
get => FontFamilyContentSetting + ",Microsoft YaHei UI";
set => FontFamilyContentSetting = value;
}
/// <summary> /// <summary>
/// 头像服务器 /// 头像服务器
/// </summary> /// </summary>

View file

@ -356,6 +356,8 @@
<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 SETTING</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.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.AutoFetch">Fetch remotes automatically (need restart)</sys:String> <sys:String x:Key="Text.Preference.AutoFetch">Fetch remotes automatically (need restart)</sys:String>

View file

@ -355,6 +355,8 @@
<sys:String x:Key="Text.Preference">偏好设置</sys:String> <sys:String x:Key="Text.Preference">偏好设置</sys:String>
<sys:String x:Key="Text.Preference.General">通用配置</sys:String> <sys:String x:Key="Text.Preference.General">通用配置</sys:String>
<sys:String x:Key="Text.Preference.Locale">显示语言</sys:String> <sys:String x:Key="Text.Preference.Locale">显示语言</sys:String>
<sys:String x:Key="Text.Preference.FontFamilyWindow">系统字体</sys:String>
<sys:String x:Key="Text.Preference.FontFamilyContent">文本字体</sys:String>
<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.AutoFetch">启用定时自动拉取远程更新(重启生效)</sys:String> <sys:String x:Key="Text.Preference.AutoFetch">启用定时自动拉取远程更新(重启生效)</sys:String>

View file

@ -1,5 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:models="clr-namespace:SourceGit.Models">
<Style TargetType="{x:Type MenuItem}"> <Style TargetType="{x:Type MenuItem}">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
@ -7,7 +8,7 @@
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/> <Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="MinHeight" Value="24"/> <Setter Property="MinHeight" Value="24"/>
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="TextElement.FontFamily" Value="Microsoft YaHei UI"/> <Setter Property="FontFamily" Value="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyWindow, Mode=OneWay}" />
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/> <Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/> <Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/> <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>

View file

@ -1,5 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:models="clr-namespace:SourceGit.Models">
<Style x:Key="Style.DataGridCell" TargetType="{x:Type DataGridCell}"> <Style x:Key="Style.DataGridCell" TargetType="{x:Type DataGridCell}">
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
@ -44,7 +45,7 @@
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG1}"/> <Setter Property="TextElement.Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="TextElement.FontFamily" Value="Consolas,Microsoft YaHei UI"/> <Setter Property="TextElement.FontFamily" Value="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}"/>
<Setter Property="EnableColumnVirtualization" Value="True"/> <Setter Property="EnableColumnVirtualization" Value="True"/>
<Setter Property="EnableRowVirtualization" Value="True"/> <Setter Property="EnableRowVirtualization" Value="True"/>
<Setter Property="RowBackground" Value="Transparent"/> <Setter Property="RowBackground" Value="Transparent"/>

View file

@ -49,7 +49,6 @@
<Style TargetType="{x:Type TextBlock}" BasedOn="{x:Null}"> <Style TargetType="{x:Type TextBlock}" BasedOn="{x:Null}">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/> <Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="FontWeight" Value="DemiBold"/> <Setter Property="FontWeight" Value="DemiBold"/>
<Setter Property="FontFamily" Value="Microsoft YaHei UI"/>
<Setter Property="FontSize" Value="9pt"/> <Setter Property="FontSize" Value="9pt"/>
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/> <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
<Style.Triggers> <Style.Triggers>

View file

@ -3,7 +3,6 @@
xmlns:controls="clr-namespace:SourceGit.Views.Controls"> xmlns:controls="clr-namespace:SourceGit.Views.Controls">
<Style x:Key="Style.TextBlock.Base" TargetType="{x:Type TextBlock}"> <Style x:Key="Style.TextBlock.Base" TargetType="{x:Type TextBlock}">
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="FontFamily" Value="Consolas,Microsoft YaHei UI"/>
<Setter Property="FontSize" Value="9pt"/> <Setter Property="FontSize" Value="9pt"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/> <Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="HorizontalAlignment" Value="Left"/>
@ -20,7 +19,6 @@
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/> <Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
<Setter Property="FontFamily" Value="Microsoft YaHei UI"/>
<Setter Property="FontWeight" Value="ExtraBold"/> <Setter Property="FontWeight" Value="ExtraBold"/>
<Setter Property="FontSize" Value="9pt"/> <Setter Property="FontSize" Value="9pt"/>
<Setter Property="Margin" Value="8,0,0,0"/> <Setter Property="Margin" Value="8,0,0,0"/>

View file

@ -7,7 +7,6 @@
<Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextElement.FontFamily" Value="Consolas,Microsoft YaHei UI"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/> <Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="CaretBrush" Value="{DynamicResource Brush.FG1}"/> <Setter Property="CaretBrush" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>

View file

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:SourceGit.Views.Controls"> xmlns:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:models="clr-namespace:SourceGit.Models">
<Style x:Key="Style.TreeView.ToggleButton" TargetType="{x:Type ToggleButton}"> <Style x:Key="Style.TreeView.ToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable" Value="False"/> <Setter Property="Focusable" Value="False"/>
@ -58,8 +59,7 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
ContentSource="Header" ContentSource="Header"/>
TextElement.FontFamily="Consolas,Microsoft YaHei UI"/>
</Grid> </Grid>
</Border> </Border>
<ItemsPresenter x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <ItemsPresenter x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
@ -97,6 +97,7 @@
<Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Standard" /> <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Standard" />
<Setter Property="ScrollViewer.CanContentScroll" Value="True" /> <Setter Property="ScrollViewer.CanContentScroll" Value="True" />
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="TextElement.FontFamily" Value="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}"/>
<Setter Property="ItemsPanel"> <Setter Property="ItemsPanel">
<Setter.Value> <Setter.Value>
<ItemsPanelTemplate> <ItemsPanelTemplate>

View file

@ -1,6 +1,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:models="clr-namespace:SourceGit.Models">
<Style x:Key="Style.Window" TargetType="{x:Type Window}"> <Style x:Key="Style.Window" TargetType="{x:Type Window}">
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
@ -12,6 +13,7 @@
<Setter Property="TextOptions.TextHintingMode" Value="Animated"/> <Setter Property="TextOptions.TextHintingMode" Value="Animated"/>
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/> <Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/> <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
<Setter Property="FontFamily" Value="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyWindow, Mode=OneWay}"/>
<Setter Property="WindowChrome.WindowChrome"> <Setter Property="WindowChrome.WindowChrome">
<Setter.Value> <Setter.Value>

View file

@ -6,6 +6,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:models="clr-namespace:SourceGit.Models"
mc:Ignorable="d" mc:Ignorable="d"
Title="{DynamicResource Text.Blame}" Title="{DynamicResource Text.Blame}"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
@ -56,8 +57,8 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="txtFile" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/> <TextBlock Grid.Column="0" x:Name="txtFile" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{DynamicResource Brush.FG2}" FontSize="11" Text="{DynamicResource Text.Blame.Tip}"/> <TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{DynamicResource Brush.FG2}" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" FontSize="11" Text="{DynamicResource Text.Blame.Tip}"/>
</Grid> </Grid>
</Border> </Border>

View file

@ -136,7 +136,7 @@ namespace SourceGit.Views.Controls {
placeholder, placeholder,
CultureInfo.CurrentCulture, CultureInfo.CurrentCulture,
FlowDirection.LeftToRight, FlowDirection.LeftToRight,
new Typeface(new FontFamily("Consolas"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), new Typeface(new FontFamily(Models.Preference.Instance.General.FontFamilyWindow), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
a.Width * 0.65, a.Width * 0.65,
Brushes.White, Brushes.White,
VisualTreeHelper.GetDpi(a).PixelsPerDip); VisualTreeHelper.GetDpi(a).PixelsPerDip);

View file

@ -74,7 +74,7 @@ namespace SourceGit.Views.Controls {
txt, txt,
CultureInfo.CurrentCulture, CultureInfo.CurrentCulture,
FlowDirection.LeftToRight, FlowDirection.LeftToRight,
new Typeface(new FontFamily("Microsoft YaHei UI"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal), new Typeface(new FontFamily(Models.Preference.Instance.General.FontFamilyWindow), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
icon.Width * 0.8, icon.Width * 0.8,
new SolidColorBrush(Color.FromRgb(241, 241, 241)), new SolidColorBrush(Color.FromRgb(241, 241, 241)),
VisualTreeHelper.GetDpi(icon).PixelsPerDip); VisualTreeHelper.GetDpi(icon).PixelsPerDip);

View file

@ -49,7 +49,7 @@ namespace SourceGit.Views.Controls {
Placeholder, Placeholder,
CultureInfo.CurrentCulture, CultureInfo.CurrentCulture,
FlowDirection.LeftToRight, FlowDirection.LeftToRight,
new Typeface(new FontFamily("Microsoft YaHei UI"), FontStyle, FontWeight, FontStretch), new Typeface(new FontFamily(Models.Preference.Instance.General.FontFamilyWindow), FontStyle, FontWeight, FontStretch),
FontSize, FontSize,
FindResource("Brush.FG2") as Brush, FindResource("Brush.FG2") as Brush,
new NumberSubstitution(), new NumberSubstitution(),

View file

@ -0,0 +1,20 @@
using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
namespace SourceGit.Views.Converters {
public class FontFamiliesToName : IValueConverter {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
if (value is string s)
return s.Split(',').ElementAt(0);
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
return value;
}
}
}

View file

@ -78,7 +78,7 @@
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Height="20"> <StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Name}" Margin="4,0"/> <TextBlock Text="{Binding Name}" Margin="4,0"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontFamily="Microsoft YaHei UI" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/> <TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>

View file

@ -38,7 +38,6 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Init.Tip}" Text="{DynamicResource Text.Init.Tip}"
FontFamily="Microsoft YaHei UI"
Foreground="{DynamicResource Brush.FG2}"/> Foreground="{DynamicResource Brush.FG2}"/>
</Grid> </Grid>
</controls:PopupWidget> </controls:PopupWidget>

View file

@ -62,7 +62,7 @@
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Height="20"> <StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Name}" Margin="4,0"/> <TextBlock Text="{Binding Name}" Margin="4,0"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontFamily="Microsoft YaHei UI" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/> <TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>

View file

@ -72,7 +72,7 @@
<Path Grid.Column="0" Width="12" Height="12" Fill="{Binding Color}" Data="M 0,0 A 180,180 180 1 1 1,1 Z"/> <Path Grid.Column="0" Width="12" Height="12" Fill="{Binding Color}" Data="M 0,0 A 180,180 180 1 1 1,1 Z"/>
<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="4,0,0,0"/> <TextBlock Grid.Column="1" Text="{Binding Name}" Margin="4,0,0,0"/>
<TextBlock Grid.Column="2" Text="{Binding Desc}" FontFamily="Microsoft YaHei UI" FontSize="11" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/> <TextBlock Grid.Column="2" Text="{Binding Desc}" FontSize="11" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>

View file

@ -7,12 +7,16 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:controls="clr-namespace:SourceGit.Views.Controls"
xmlns:models="clr-namespace:SourceGit.Models" xmlns:models="clr-namespace:SourceGit.Models"
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
mc:Ignorable="d" mc:Ignorable="d"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
ResizeMode="NoResize" ResizeMode="NoResize"
Title="{DynamicResource Text.Preference}" Title="{DynamicResource Text.Preference}"
Width="500" SizeToContent="Height"> Width="500" SizeToContent="Height">
<Grid> <Grid>
<Grid.Resources>
<converters:FontFamiliesToName x:Key="FontFamiliesToName"/>
</Grid.Resources>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="1"/> <RowDefinition Height="1"/>
@ -58,6 +62,8 @@
<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="8"/>
<RowDefinition Height="36"/> <RowDefinition Height="36"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
@ -99,14 +105,58 @@
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}" SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"
SelectionChanged="LocaleChanged"/> SelectionChanged="LocaleChanged"/>
<!-- Avatar --> <!-- System Font -->
<TextBlock <TextBlock
Grid.Row="2" Grid.Column="0" 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}" Text="{DynamicResource Text.Preference.AvatarServer}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<ComboBox <ComboBox
Grid.Row="2" Grid.Column="1" Grid.Row="4" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}" ItemsSource="{Binding Source={x:Static models:AvatarServer.Supported}}"
DisplayMemberPath="Name" DisplayMemberPath="Name"
@ -115,36 +165,36 @@
<!-- Enable Check For Update --> <!-- Enable Check For Update -->
<CheckBox <CheckBox
Grid.Row="3" Grid.Column="1" Grid.Row="5" Grid.Column="1"
Content="{DynamicResource Text.Preference.CheckUpdate}" Content="{DynamicResource Text.Preference.CheckUpdate}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/> IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
<!-- Auto Fetch --> <!-- Auto Fetch -->
<CheckBox <CheckBox
Grid.Row="4" Grid.Column="1" Grid.Row="6" Grid.Column="1"
Content="{DynamicResource Text.Preference.AutoFetch}" Content="{DynamicResource Text.Preference.AutoFetch}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/> IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/>
<!-- Restore Windows --> <!-- Restore Windows -->
<CheckBox <CheckBox
Grid.Row="5" Grid.Column="1" Grid.Row="7" Grid.Column="1"
Content="{DynamicResource Text.Preference.RestoreTabs}" Content="{DynamicResource Text.Preference.RestoreTabs}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/> IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/>
<!-- Git Group --> <!-- Git Group -->
<TextBlock <TextBlock
Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Preference.Git}" Text="{DynamicResource Text.Preference.Git}"
FontSize="16" FontWeight="DemiBold" FontSize="16" FontWeight="DemiBold"
Foreground="{DynamicResource Brush.FG2}"/> Foreground="{DynamicResource Brush.FG2}"/>
<!-- Git Executable Path --> <!-- Git Executable Path -->
<TextBlock <TextBlock
Grid.Row="8" Grid.Column="0" Grid.Row="10" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Path}" Text="{DynamicResource Text.Preference.Git.Path}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<Grid Grid.Row="8" Grid.Column="1"> <Grid Grid.Row="10" Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@ -167,11 +217,11 @@
<!-- Default Clone Dir --> <!-- Default Clone Dir -->
<TextBlock <TextBlock
Grid.Row="9" Grid.Column="0" Grid.Row="11" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Dir}" Text="{DynamicResource Text.Preference.Git.Dir}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<Grid Grid.Row="9" Grid.Column="1"> <Grid Grid.Row="11" Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@ -194,36 +244,36 @@
<!-- User --> <!-- User -->
<TextBlock <TextBlock
Grid.Row="10" Grid.Column="0" Grid.Row="12" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.User}" Text="{DynamicResource Text.Preference.Git.User}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<controls:TextEdit <controls:TextEdit
Grid.Row="10" Grid.Column="1" Grid.Row="12" Grid.Column="1"
Height="24" Height="24"
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}" Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/> Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/>
<!-- Email --> <!-- Email -->
<TextBlock <TextBlock
Grid.Row="11" Grid.Column="0" Grid.Row="13" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Email}" 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="11" Grid.Column="1" Grid.Row="13" Grid.Column="1"
Height="24" Height="24"
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}" Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/> Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/>
<!-- CRLF --> <!-- CRLF -->
<TextBlock <TextBlock
Grid.Row="12" Grid.Column="0" Grid.Row="14" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.CRLF}" Text="{DynamicResource Text.Preference.Git.CRLF}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<ComboBox <ComboBox
Grid.Row="12" Grid.Column="1" Grid.Row="14" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}" ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
SelectedValuePath="Value" SelectedValuePath="Value"
@ -232,7 +282,7 @@
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Height="20"> <StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Display}" Margin="2,0"/> <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> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
@ -240,19 +290,19 @@
<!-- Merge Tool Group --> <!-- Merge Tool Group -->
<TextBlock <TextBlock
Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Preference.Merger}" Text="{DynamicResource Text.Preference.Merger}"
FontSize="16" FontWeight="DemiBold" FontSize="16" FontWeight="DemiBold"
Foreground="{DynamicResource Brush.FG2}"/> Foreground="{DynamicResource Brush.FG2}"/>
<!-- Merge Tool Type --> <!-- Merge Tool Type -->
<TextBlock <TextBlock
Grid.Row="15" Grid.Column="0" Grid.Row="17" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Type}" Text="{DynamicResource Text.Preference.Merger.Type}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<ComboBox <ComboBox
Grid.Row="15" Grid.Column="1" Grid.Row="17" Grid.Column="1"
Height="24" Height="24"
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}" ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
DisplayMemberPath="Name" DisplayMemberPath="Name"
@ -262,11 +312,11 @@
<!-- Merge Tool Executable Path --> <!-- Merge Tool Executable Path -->
<TextBlock <TextBlock
Grid.Row="16" Grid.Column="0" Grid.Row="18" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Path}" Text="{DynamicResource Text.Preference.Merger.Path}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,8,0"/> Margin="0,0,8,0"/>
<Grid Grid.Row="16" Grid.Column="1"> <Grid Grid.Row="18" Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>

View file

@ -7,7 +7,8 @@
xmlns:models="clr-namespace:SourceGit.Models" xmlns:models="clr-namespace:SourceGit.Models"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets" xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800"
FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}">
<TabControl x:Name="body"> <TabControl x:Name="body">
<TabItem Header="{DynamicResource Text.CommitViewer.Info}"> <TabItem Header="{DynamicResource Text.CommitViewer.Info}">
<Grid> <Grid>

View file

@ -27,13 +27,13 @@
<Button Click="Explore" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Explore.Tip}" BorderThickness="0"> <Button Click="Explore" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Folder.Open}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Folder.Open}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Explore}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Explore}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="Terminal" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Terminal.Tip}" BorderThickness="0"> <Button Click="Terminal" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Terminal.Tip}" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="13" Height="13" Data="{StaticResource Icon.Terminal}"/> <Path Width="13" Height="13" Data="{StaticResource Icon.Terminal}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Terminal}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Terminal}"/>
</StackPanel> </StackPanel>
</Button> </Button>
</StackPanel> </StackPanel>
@ -42,31 +42,31 @@
<Button Click="OpenFetch" Margin="8,0" BorderThickness="0"> <Button Click="OpenFetch" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Fetch}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Fetch}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Fetch}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Fetch}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="OpenPull" Margin="8,0" BorderThickness="0"> <Button Click="OpenPull" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Pull}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Pull}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Pull}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Pull}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="OpenPush" Margin="8,0" BorderThickness="0"> <Button Click="OpenPush" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Push}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Push}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Push}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Push}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="OpenStash" Margin="8,0" BorderThickness="0"> <Button Click="OpenStash" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.SaveStash}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.SaveStash}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Stash}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Stash}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="OpenApply" Margin="8,0" BorderThickness="0"> <Button Click="OpenApply" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Apply}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Apply}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Apply}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Apply}"/>
</StackPanel> </StackPanel>
</Button> </Button>
</StackPanel> </StackPanel>
@ -75,13 +75,13 @@
<Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Search.Tip}"> <Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Search.Tip}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Search}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Search}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Search}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Search}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Configure.Tip}"> <Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Configure.Tip}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Setting}"/> <Path Width="14" Height="14" Data="{StaticResource Icon.Setting}"/>
<TextBlock Margin="4,0" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Configure}"/> <TextBlock Margin="4,0" FontWeight="Bold" Text="{DynamicResource Text.Configure}"/>
</StackPanel> </StackPanel>
</Button> </Button>
</StackPanel> </StackPanel>
@ -123,7 +123,7 @@
<ListViewItem IsSelected="True"> <ListViewItem IsSelected="True">
<StackPanel Margin="16,0,0,0" Height="28" Orientation="Horizontal"> <StackPanel Margin="16,0,0,0" Height="28" Orientation="Horizontal">
<Path Width="16" Height="16" Data="{StaticResource Icon.Histories}"/> <Path Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
<TextBlock Margin="8,0,0,0" FontWeight="Bold" Text="{DynamicResource Text.Histories}"/> <TextBlock Margin="8,0,0,0" Text="{DynamicResource Text.Histories}"/>
</StackPanel> </StackPanel>
</ListViewItem> </ListViewItem>
<ListViewItem> <ListViewItem>
@ -134,7 +134,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Send}"/> <Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Send}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy}"/> <TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{DynamicResource Text.WorkingCopy}"/>
<controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeLocalChanges"/> <controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeLocalChanges"/>
</Grid> </Grid>
</ListViewItem> </ListViewItem>
@ -146,7 +146,7 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Stashes}"/> <Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Stashes}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontWeight="Bold" Text="{DynamicResource Text.Stashes}"/> <TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{DynamicResource Text.Stashes}"/>
<controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeStashes"/> <controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeStashes"/>
</Grid> </Grid>
</ListViewItem> </ListViewItem>

View file

@ -7,7 +7,8 @@
xmlns:models="clr-namespace:SourceGit.Models" xmlns:models="clr-namespace:SourceGit.Models"
mc:Ignorable="d" mc:Ignorable="d"
Background="{DynamicResource Brush.Window}" Background="{DynamicResource Brush.Window}"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800"
FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}">
<UserControl.Resources> <UserControl.Resources>
<Style x:Key="Style.DataGridRow.DiffViewer" TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}"> <Style x:Key="Style.DataGridRow.DiffViewer" TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
<EventSetter Event="RequestBringIntoView" Handler="OnTextDiffBringIntoView"/> <EventSetter Event="RequestBringIntoView" Handler="OnTextDiffBringIntoView"/>

View file

@ -28,7 +28,6 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Text="{DynamicResource Text.Launcher.Error}" Text="{DynamicResource Text.Launcher.Error}"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"/> FontWeight="Bold"/>
<controls:TextEdit <controls:TextEdit
Grid.Row="1" Grid.Row="1"
@ -39,14 +38,12 @@
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
MaxHeight="80" MaxHeight="80"
Margin="0,8" Margin="0,8"
FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top"/> VerticalAlignment="Top"/>
<Button <Button
Grid.Row="2" Grid.Row="2"
Height="25" Height="25"
Margin="4,0" Padding="8,0" Margin="4,0" Padding="8,0"
Click="Dismiss" Click="Dismiss"
FontFamily="Microsoft YaHei UI"
Content="{DynamicResource Text.Close}" Content="{DynamicResource Text.Close}"
Background="{DynamicResource Brush.Accent1}" Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}" BorderBrush="{DynamicResource Brush.FG1}"

View file

@ -27,8 +27,8 @@
<TextBlock Margin="8,8,0,18" x:Name="txtTitle" FontSize="18" FontWeight="DemiBold" TextOptions.TextFormattingMode="Ideal" RenderOptions.ClearTypeHint="Enabled"/> <TextBlock Margin="8,8,0,18" x:Name="txtTitle" FontSize="18" FontWeight="DemiBold" TextOptions.TextFormattingMode="Ideal" RenderOptions.ClearTypeHint="Enabled"/>
<ContentControl x:Name="container"/> <ContentControl x:Name="container"/>
<StackPanel Margin="0,16,0,0" Height="32" Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Margin="0,16,0,0" Height="32" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Click="Sure" Width="80" Content="{DynamicResource Text.Sure}" BorderBrush="{DynamicResource Brush.FG1}" Background="{DynamicResource Brush.Accent1}" FontFamily="Microsoft YaHei UI" FontWeight="Bold"/> <Button Click="Sure" Width="80" Content="{DynamicResource Text.Sure}" BorderBrush="{DynamicResource Brush.FG1}" Background="{DynamicResource Brush.Accent1}" FontWeight="Bold"/>
<Button Click="Cancel" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}" FontFamily="Microsoft YaHei UI" FontWeight="Bold"/> <Button Click="Cancel" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}" FontWeight="Bold"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Border> </Border>

View file

@ -138,7 +138,7 @@ namespace SourceGit.Views.Widgets {
#region EVENTS #region EVENTS
private void LayoutTextPreview(List<Models.TextLine> lines) { private void LayoutTextPreview(List<Models.TextLine> lines) {
var font = new FontFamily("Consolas"); var font = new FontFamily(Models.Preference.Instance.General.FontFamilyWindow);
var maxLineNumber = $"{lines.Count + 1}"; var maxLineNumber = $"{lines.Count + 1}";
var formatted = new FormattedText( var formatted = new FormattedText(

View file

@ -37,7 +37,6 @@
Margin="4,0,0,0" Margin="4,0,0,0"
Text="{DynamicResource Text.Stashes.Stashes}" Text="{DynamicResource Text.Stashes.Stashes}"
Foreground="{DynamicResource Brush.FG2}" Foreground="{DynamicResource Brush.FG2}"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"/> FontWeight="Bold"/>
<controls:Loading <controls:Loading
@ -89,7 +88,6 @@
Margin="4,0,0,0" Margin="4,0,0,0"
Text="{DynamicResource Text.Stashes.Changes}" Text="{DynamicResource Text.Stashes.Changes}"
Foreground="{DynamicResource Brush.FG2}" Foreground="{DynamicResource Brush.FG2}"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"/> FontWeight="Bold"/>
</StackPanel> </StackPanel>
</Border> </Border>

View file

@ -10,7 +10,8 @@
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets" xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
xmlns:validations="clr-namespace:SourceGit.Views.Validations" xmlns:validations="clr-namespace:SourceGit.Views.Validations"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800"
FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}">
<UserControl.Resources> <UserControl.Resources>
<converter:BoolToCollapsed x:Key="BoolToCollapsed"/> <converter:BoolToCollapsed x:Key="BoolToCollapsed"/>
</UserControl.Resources> </UserControl.Resources>
@ -53,7 +54,6 @@
Margin="6,0" Margin="6,0"
Text="{DynamicResource Text.WorkingCopy.Unstaged}" Text="{DynamicResource Text.WorkingCopy.Unstaged}"
Foreground="{DynamicResource Brush.FG2}" Foreground="{DynamicResource Brush.FG2}"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"/> FontWeight="Bold"/>
<controls:Loading <controls:Loading
Grid.Column="2" Grid.Column="2"
@ -108,7 +108,6 @@
Margin="6,0" Margin="6,0"
Text="{DynamicResource Text.WorkingCopy.Staged}" Text="{DynamicResource Text.WorkingCopy.Staged}"
Foreground="{DynamicResource Brush.FG2}" Foreground="{DynamicResource Brush.FG2}"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"/> FontWeight="Bold"/>
<controls:IconButton <controls:IconButton
@ -233,7 +232,6 @@
Height="26" Height="26"
Padding="8,0" Padding="8,0"
Click="Commit" Click="Commit"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold" FontWeight="Bold"
Background="{DynamicResource Brush.Accent1}" Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}" BorderBrush="{DynamicResource Brush.FG1}"
@ -245,7 +243,6 @@
Height="26" Height="26"
Padding="8,0" Padding="8,0"
Click="CommitAndPush" Click="CommitAndPush"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold" FontWeight="Bold"
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}" Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
Margin="8,0,0,0"/> Margin="8,0,0,0"/>