fix<Manager>: use TextBlock instead of Label to show special characters like '-', '_' etc.

This commit is contained in:
leo 2020-12-07 19:28:36 +08:00
parent d993147107
commit 3282496570
2 changed files with 9 additions and 7 deletions

View file

@ -150,8 +150,10 @@
<!-- Name & Path --> <!-- Name & Path -->
<StackPanel Grid.Row="0" Orientation="Horizontal"> <StackPanel Grid.Row="0" Orientation="Horizontal">
<Label x:Name="repoName" FontSize="20" FontWeight="Bold"/> <TextBlock x:Name="repoName" Margin="4,0,0,0" FontSize="28" FontWeight="Bold" FontFamily="Consolas" Foreground="{StaticResource Brush.FG}" VerticalAlignment="Center"/>
<Label x:Name="repoPath" FontSize="20" FontWeight="Light" Opacity="0.5" VerticalAlignment="Center"/> <Border Background="{StaticResource Brush.BG4}" Margin="16,0,0,0" Height="26" CornerRadius="4" VerticalAlignment="Center">
<TextBlock x:Name="repoPath" FontSize="20" Margin="8,0" FontWeight="Light" FontFamily="Consolas" Foreground="{StaticResource Brush.FG2}" VerticalAlignment="Center"/>
</Border>
</StackPanel> </StackPanel>
<!-- Status of selected repository --> <!-- Status of selected repository -->
@ -167,7 +169,7 @@
<Border Background="{StaticResource Brush.BG4}" Height="18" CornerRadius="4" VerticalAlignment="Center"> <Border Background="{StaticResource Brush.BG4}" Height="18" CornerRadius="4" VerticalAlignment="Center">
<Label x:Name="lastCommitId" Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas" Padding="4,0" VerticalAlignment="Center"/> <Label x:Name="lastCommitId" Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas" Padding="4,0" VerticalAlignment="Center"/>
</Border> </Border>
<Label x:Name="lastCommit" Margin="2,0,0,0"/> <TextBlock x:Name="lastCommit" Margin="4,0,0,0" FontFamily="Consolas" Foreground="{StaticResource Brush.FG}" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
<!-- README.md --> <!-- README.md -->

View file

@ -357,8 +357,8 @@ namespace SourceGit.UI {
briefMask.Visibility = Visibility.Hidden; briefMask.Visibility = Visibility.Hidden;
repoName.Content = repo.Name; repoName.Text = repo.Name;
repoPath.Content = repo.Path; repoPath.Text = repo.Path;
Task.Run(() => { Task.Run(() => {
var changes = repo.LocalChanges(); var changes = repo.LocalChanges();
@ -377,10 +377,10 @@ namespace SourceGit.UI {
if (commits.Count > 0) { if (commits.Count > 0) {
var c = commits[0]; var c = commits[0];
lastCommitId.Content = c.ShortSHA; lastCommitId.Content = c.ShortSHA;
lastCommit.Content = c.Subject; lastCommit.Text = c.Subject;
} else { } else {
lastCommitId.Content = "---"; lastCommitId.Content = "---";
lastCommit.Content = ""; lastCommit.Text = "";
} }
}); });
}); });