feature: show commit gpg sign status (#614)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-10-29 21:03:45 +08:00
parent 5c92fbdb37
commit 279b1819a3
No known key found for this signature in database
7 changed files with 131 additions and 1 deletions

View file

@ -60,6 +60,22 @@
Margin="12,0,4,0"
VerticalAlignment="Center"/>
<ContentControl Content="{Binding #ThisControl.SignInfo}">
<ContentControl.Styles>
<Style Selector="ToolTip">
<Setter Property="MaxWidth" Value="800"/>
</Style>
</ContentControl.Styles>
<ContentControl.DataTemplates>
<DataTemplate DataType="m:CommitSignInfo">
<Border Width="24" Background="Transparent" ToolTip.Tip="{Binding ToolTip}">
<Path Width="14" Height="14" Data="{StaticResource Icons.Verified}" Fill="{Binding Brush}"/>
</Border>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
<Button Classes="icon_button" Width="24" Cursor="Hand" Click="OnCopyCommitSHA" ToolTip.Tip="{DynamicResource Text.Copy}">
<Path Width="12" Height="12" Data="{StaticResource Icons.Copy}"/>
</Button>
@ -105,7 +121,7 @@
VerticalAlignment="Center"
UseGraphColor="False"/>
</Border>
<!-- Messages -->
<TextBlock Grid.Row="3" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Message}" VerticalAlignment="Top" Margin="0,4,0,0" />
<v:CommitMessagePresenter Grid.Row="3" Grid.Column="1"

View file

@ -17,6 +17,15 @@ namespace SourceGit.Views
set => SetValue(MessageProperty, value);
}
public static readonly StyledProperty<Models.CommitSignInfo> SignInfoProperty =
AvaloniaProperty.Register<CommitBaseInfo, Models.CommitSignInfo>(nameof(SignInfo));
public Models.CommitSignInfo SignInfo
{
get => GetValue(SignInfoProperty);
set => SetValue(SignInfoProperty, value);
}
public static readonly StyledProperty<bool> SupportsContainsInProperty =
AvaloniaProperty.Register<CommitBaseInfo, bool>(nameof(SupportsContainsIn));

View file

@ -21,6 +21,7 @@
<!-- Base Information -->
<v:CommitBaseInfo Content="{Binding Commit}"
Message="{Binding FullMessage}"
SignInfo="{Binding SignInfo}"
SupportsContainsIn="True"
WebLinks="{Binding WebLinks}"
IssueTrackerRules="{Binding IssueTrackerRules}"/>