mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
style<*>: change font render mode
This commit is contained in:
parent
0b581752fb
commit
a94a62bd27
10 changed files with 53 additions and 45 deletions
|
@ -14,6 +14,9 @@
|
||||||
<Setter Property="Grid.IsSharedSizeScope" Value="False" />
|
<Setter Property="Grid.IsSharedSizeScope" Value="False" />
|
||||||
<Setter Property="HorizontalOffset" Value="-4"/>
|
<Setter Property="HorizontalOffset" Value="-4"/>
|
||||||
<Setter Property="VerticalOffset" Value="-4"/>
|
<Setter Property="VerticalOffset" Value="-4"/>
|
||||||
|
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
|
||||||
|
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
|
||||||
|
<Setter Property="TextElement.FontSize" Value="9pt"/>
|
||||||
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<Style TargetType="{x:Type TextBlock}">
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<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"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<Style x:Key="Style.TextBlock.LineNumber" TargetType="{x:Type TextBlock}">
|
<Style x:Key="Style.TextBlock.LineNumber" TargetType="{x:Type TextBlock}">
|
||||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<Setter Property="FontSize" Value="9pt"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
|
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<Style x:Key="Style.TextBlock.LineContent" TargetType="{x:Type TextBlock}">
|
<Style x:Key="Style.TextBlock.LineContent" TargetType="{x:Type TextBlock}">
|
||||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<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"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
|
|
@ -55,9 +55,10 @@
|
||||||
x:Name="PART_Header"
|
x:Name="PART_Header"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||||
ContentSource="Header"
|
ContentSource="Header"
|
||||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
TextElement.FontFamily="Consolas,SimSun"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<ItemsPresenter x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
<ItemsPresenter x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
xmlns:models="clr-namespace:SourceGit.Models"
|
xmlns:models="clr-namespace:SourceGit.Models"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
UseLayoutRounding="True"
|
UseLayoutRounding="True"
|
||||||
Title="{StaticResource Text.About.Title}"
|
|
||||||
MinWidth="1280" MinHeight="720"
|
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
|
TextOptions.TextFormattingMode="Display"
|
||||||
|
TextOptions.TextRenderingMode="ClearType"
|
||||||
|
MinWidth="1280" MinHeight="720"
|
||||||
|
Title="{StaticResource Text.About.Title}"
|
||||||
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
|
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
|
||||||
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}">
|
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}">
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Text="{Binding Path, Converter={StaticResource PureFileName}}"
|
Text="{Binding Path, Converter={StaticResource PureFileName}}"
|
||||||
Margin="4,0,0,0"
|
Margin="4,0,0,0"
|
||||||
FontSize="11"/>
|
FontSize="9pt"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<HierarchicalDataTemplate.Triggers>
|
<HierarchicalDataTemplate.Triggers>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<controls:TextEdit x:Name="txtAuthorName" IsReadOnly="True" BorderThickness="0"/>
|
<controls:TextEdit x:Name="txtAuthorName" IsReadOnly="True" BorderThickness="0"/>
|
||||||
<controls:TextEdit x:Name="txtAuthorEmail" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" Margin="4,0,0,0"/>
|
<controls:TextEdit x:Name="txtAuthorEmail" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" Margin="4,0,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<controls:TextEdit x:Name="txtAuthorTime" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" FontSize="10"/>
|
<controls:TextEdit x:Name="txtAuthorTime" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" FontSize="8pt"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Committer Avatar -->
|
<!-- Committer Avatar -->
|
||||||
|
@ -171,7 +171,7 @@
|
||||||
Grid.Row="3" Grid.Column="1"
|
Grid.Row="3" Grid.Column="1"
|
||||||
x:Name="txtMessage"
|
x:Name="txtMessage"
|
||||||
IsReadOnly="true"
|
IsReadOnly="true"
|
||||||
FontFamily="Consolas"
|
FontFamily="Consolas,SimSun"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="11,5,16,0"
|
Margin="11,5,16,0"
|
||||||
|
|
|
@ -24,65 +24,65 @@
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="6,0">
|
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="6,0">
|
||||||
<Button Click="Explore" Margin="4,0,0,0" ToolTip="{StaticResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
|
<Button Click="Explore" Margin="6,0" ToolTip="{StaticResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="16" Height="14" Data="{StaticResource Icon.Folder.Open}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Folder.Open}"/>
|
||||||
<Label Content="{StaticResource Text.Dashboard.Explore}"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Explore}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Click="Terminal" Margin="4,0,0,0" ToolTip="{StaticResource Text.Dashboard.Terminal.Tip}" BorderThickness="0">
|
<Button Click="Terminal" Margin="6,0" ToolTip="{StaticResource 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}"/>
|
||||||
<Label Content="{StaticResource Text.Dashboard.Terminal}"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Terminal}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||||
<Button Click="OpenFetch" BorderThickness="0">
|
<Button Click="OpenFetch" Margin="8,0" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal" Margin="6,0">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Fetch}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Fetch}"/>
|
||||||
<Label Content="{StaticResource Text.Fetch}" Margin="2,0,0,0"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Fetch}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Click="OpenPull" BorderThickness="0">
|
<Button Click="OpenPull" Margin="8,0" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal" Margin="6,0">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Pull}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Pull}"/>
|
||||||
<Label Content="{StaticResource Text.Pull}" Margin="2,0,0,0"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Pull}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Click="OpenPush" BorderThickness="0">
|
<Button Click="OpenPush" Margin="8,0" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal" Margin="6,0">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.Push}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Push}"/>
|
||||||
<Label Content="{StaticResource Text.Push}" Margin="2,0,0,0"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Push}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Click="OpenStash" BorderThickness="0">
|
<Button Click="OpenStash" Margin="8,0" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal" Margin="6,0">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icon.SaveStash}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.SaveStash}"/>
|
||||||
<Label Content="{StaticResource Text.Stash}" Margin="2,0,0,0"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Stash}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Click="OpenApply" BorderThickness="0">
|
<Button Click="OpenApply" Margin="8,0" BorderThickness="0">
|
||||||
<StackPanel Orientation="Horizontal" Margin="6,0">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Margin="0,2,0,0" Data="{StaticResource Icon.Apply}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Apply}"/>
|
||||||
<Label Content="{StaticResource Text.Apply}" Margin="2,0,0,0"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Apply}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button Click="OpenSearch" Margin="4,0,0,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Search.Tip}">
|
<Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Search.Tip}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="16" Height="16" Data="{StaticResource Icon.Search}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Search}"/>
|
||||||
<Label Content="{StaticResource Text.Dashboard.Search}"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Search}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Click="OpenConfigure" Margin="4,0,0,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Configure.Tip}">
|
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Configure.Tip}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="16" Height="16" Data="{StaticResource Icon.Setting}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icon.Setting}"/>
|
||||||
<Label Content="{StaticResource Text.Configure}"/>
|
<TextBlock Margin="4,0" FontWeight="Bold" Text="{StaticResource Text.Configure}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
@ -448,9 +448,11 @@ namespace SourceGit.Views.Widgets {
|
||||||
textContent.SetBinding(TextBlock.ForegroundProperty, new Binding("FG"));
|
textContent.SetBinding(TextBlock.ForegroundProperty, new Binding("FG"));
|
||||||
textContent.SetBinding(TextBlock.FontStyleProperty, new Binding("Style"));
|
textContent.SetBinding(TextBlock.FontStyleProperty, new Binding("Style"));
|
||||||
textContent.SetValue(TextBlock.BackgroundProperty, Brushes.Transparent);
|
textContent.SetValue(TextBlock.BackgroundProperty, Brushes.Transparent);
|
||||||
textContent.SetValue(TextBlock.FontSizeProperty, 12.0);
|
textContent.SetValue(TextBlock.FontSizeProperty, new FontSizeConverter().ConvertFrom("10pt"));
|
||||||
textContent.SetValue(TextBlock.MarginProperty, new Thickness(0));
|
textContent.SetValue(TextBlock.MarginProperty, new Thickness(0));
|
||||||
textContent.SetValue(TextBlock.PaddingProperty, new Thickness(4, 0, 0, 0));
|
textContent.SetValue(TextBlock.PaddingProperty, new Thickness(4, 0, 0, 0));
|
||||||
|
textContent.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
|
||||||
|
textContent.SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType);
|
||||||
|
|
||||||
var visualTree = new FrameworkElementFactory(typeof(Grid));
|
var visualTree = new FrameworkElementFactory(typeof(Grid));
|
||||||
visualTree.AppendChild(borderContent);
|
visualTree.AppendChild(borderContent);
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border x:Name="Color" Background="#FFFFB835">
|
<Border x:Name="Color" Background="#FFFFB835">
|
||||||
<TextBlock Text="{Binding Name}" FontSize="11" Margin="4,0" Foreground="Black"/>
|
<TextBlock Text="{Binding Name}" FontSize="8pt" Margin="4,0" Foreground="Black"/>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Subject}" Margin="2,0,0,0"/>
|
<TextBlock Text="{Binding Subject}" FontFamily="Consolas,SimSun" FontSize="10pt" Margin="2,0,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
<DataGridTemplateColumn Width="Auto" IsReadOnly="True">
|
<DataGridTemplateColumn Width="Auto" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Committer.Name}" Margin="0,0,8,0"/>
|
<TextBlock Text="{Binding Committer.Name}" FontFamily="Consolas,SimSun" FontSize="10pt" Margin="0,0,8,0"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
@ -126,15 +126,15 @@
|
||||||
<DataGridTemplateColumn Width="64" IsReadOnly="True">
|
<DataGridTemplateColumn Width="64" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding ShortSHA}"/>
|
<TextBlock Text="{Binding ShortSHA}" FontSize="10pt"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<DataGridTemplateColumn Width="128" IsReadOnly="True">
|
<DataGridTemplateColumn Width="140" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Committer.Time}"/>
|
<TextBlock Text="{Binding Committer.Time}" FontSize="10pt"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Text="{Binding Path, Converter={StaticResource PureFileName}}"
|
Text="{Binding Path, Converter={StaticResource PureFileName}}"
|
||||||
Margin="4,0,0,0"
|
Margin="4,0,0,0"
|
||||||
FontSize="11"/>
|
FontSize="9pt"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<HierarchicalDataTemplate.Triggers>
|
<HierarchicalDataTemplate.Triggers>
|
||||||
|
|
Loading…
Reference in a new issue