mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 08:34: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,7 +7,8 @@
|
|||
xmlns:models="clr-namespace:SourceGit.Models"
|
||||
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
||||
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">
|
||||
<TabItem Header="{DynamicResource Text.CommitViewer.Info}">
|
||||
<Grid>
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
<Button Click="Explore" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="Terminal" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Terminal.Tip}" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
@ -42,31 +42,31 @@
|
|||
<Button Click="OpenFetch" Margin="8,0" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="OpenPull" Margin="8,0" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="OpenPush" Margin="8,0" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="OpenStash" Margin="8,0" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="OpenApply" Margin="8,0" BorderThickness="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
@ -75,13 +75,13 @@
|
|||
<Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Search.Tip}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Configure.Tip}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
@ -123,7 +123,7 @@
|
|||
<ListViewItem IsSelected="True">
|
||||
<StackPanel Margin="16,0,0,0" Height="28" Orientation="Horizontal">
|
||||
<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>
|
||||
</ListViewItem>
|
||||
<ListViewItem>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<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"/>
|
||||
</Grid>
|
||||
</ListViewItem>
|
||||
|
@ -146,7 +146,7 @@
|
|||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<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"/>
|
||||
</Grid>
|
||||
</ListViewItem>
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
xmlns:models="clr-namespace:SourceGit.Models"
|
||||
mc:Ignorable="d"
|
||||
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>
|
||||
<Style x:Key="Style.DataGridRow.DiffViewer" TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
|
||||
<EventSetter Event="RequestBringIntoView" Handler="OnTextDiffBringIntoView"/>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Text="{DynamicResource Text.Launcher.Error}"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"/>
|
||||
<controls:TextEdit
|
||||
Grid.Row="1"
|
||||
|
@ -39,14 +38,12 @@
|
|||
VerticalScrollBarVisibility="Auto"
|
||||
MaxHeight="80"
|
||||
Margin="0,8"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
VerticalAlignment="Top"/>
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Height="25"
|
||||
Margin="4,0" Padding="8,0"
|
||||
Click="Dismiss"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
Content="{DynamicResource Text.Close}"
|
||||
Background="{DynamicResource Brush.Accent1}"
|
||||
BorderBrush="{DynamicResource Brush.FG1}"
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<TextBlock Margin="8,8,0,18" x:Name="txtTitle" FontSize="18" FontWeight="DemiBold" TextOptions.TextFormattingMode="Ideal" RenderOptions.ClearTypeHint="Enabled"/>
|
||||
<ContentControl x:Name="container"/>
|
||||
<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="Cancel" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}" 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}" FontWeight="Bold"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace SourceGit.Views.Widgets {
|
|||
|
||||
#region EVENTS
|
||||
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 formatted = new FormattedText(
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
Margin="4,0,0,0"
|
||||
Text="{DynamicResource Text.Stashes.Stashes}"
|
||||
Foreground="{DynamicResource Brush.FG2}"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"/>
|
||||
|
||||
<controls:Loading
|
||||
|
@ -89,7 +88,6 @@
|
|||
Margin="4,0,0,0"
|
||||
Text="{DynamicResource Text.Stashes.Changes}"
|
||||
Foreground="{DynamicResource Brush.FG2}"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
||||
xmlns:validations="clr-namespace:SourceGit.Views.Validations"
|
||||
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>
|
||||
<converter:BoolToCollapsed x:Key="BoolToCollapsed"/>
|
||||
</UserControl.Resources>
|
||||
|
@ -53,7 +54,6 @@
|
|||
Margin="6,0"
|
||||
Text="{DynamicResource Text.WorkingCopy.Unstaged}"
|
||||
Foreground="{DynamicResource Brush.FG2}"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"/>
|
||||
<controls:Loading
|
||||
Grid.Column="2"
|
||||
|
@ -108,7 +108,6 @@
|
|||
Margin="6,0"
|
||||
Text="{DynamicResource Text.WorkingCopy.Staged}"
|
||||
Foreground="{DynamicResource Brush.FG2}"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"/>
|
||||
|
||||
<controls:IconButton
|
||||
|
@ -233,7 +232,6 @@
|
|||
Height="26"
|
||||
Padding="8,0"
|
||||
Click="Commit"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"
|
||||
Background="{DynamicResource Brush.Accent1}"
|
||||
BorderBrush="{DynamicResource Brush.FG1}"
|
||||
|
@ -245,7 +243,6 @@
|
|||
Height="26"
|
||||
Padding="8,0"
|
||||
Click="CommitAndPush"
|
||||
FontFamily="Microsoft YaHei UI"
|
||||
FontWeight="Bold"
|
||||
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
|
||||
Margin="8,0,0,0"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue