mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 21:30:37 +08:00
style: use FontWeight.Bold for current head (#44)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
{
|
||||
@@ -6,5 +7,8 @@ namespace SourceGit.Converters
|
||||
{
|
||||
public static readonly FuncValueConverter<bool, double> ToCommitOpacity =
|
||||
new FuncValueConverter<bool, double>(x => x ? 1 : 0.5);
|
||||
|
||||
public static readonly FuncValueConverter<bool, FontWeight> ToCommitFontWeight =
|
||||
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ namespace SourceGit.Models
|
||||
get => Author != Committer || AuthorTime != CommitterTime;
|
||||
}
|
||||
|
||||
public bool IsCurrentHead
|
||||
{
|
||||
get => Decorators.Find(x => x.Type == DecoratorType.CurrentBranchHead) != null;
|
||||
}
|
||||
|
||||
public string FullMessage
|
||||
{
|
||||
get => string.IsNullOrWhiteSpace(Message) ? Subject : $"{Subject}\n\n{Message}";
|
||||
|
||||
@@ -62,7 +62,10 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<TextBlock Classes="monospace" Text="{Binding Subject}" Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/>
|
||||
<TextBlock Classes="monospace"
|
||||
Text="{Binding Subject}"
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
||||
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
@@ -88,7 +91,8 @@
|
||||
<TextBlock Classes="monospace"
|
||||
Text="{Binding Author.Name}"
|
||||
Margin="0,0,8,0"
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/>
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
||||
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -99,7 +103,8 @@
|
||||
<TextBlock Classes="monospace"
|
||||
Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
||||
Margin="12,0"
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/>
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
||||
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -110,7 +115,8 @@
|
||||
<TextBlock Classes="monospace"
|
||||
Text="{Binding CommitterTimeStr}"
|
||||
Margin="8,0"
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/>
|
||||
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
||||
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
Reference in New Issue
Block a user