mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
ux: tooltip of commit signing status icon
* do NOT show signer if it is not available * new tooltip style Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
4e87b25765
commit
195325187d
3 changed files with 23 additions and 10 deletions
|
@ -26,7 +26,7 @@
|
||||||
return new Models.CommitSignInfo()
|
return new Models.CommitSignInfo()
|
||||||
{
|
{
|
||||||
VerifyResult = lines[0][0],
|
VerifyResult = lines[0][0],
|
||||||
Signer = string.IsNullOrEmpty(lines[1]) ? "<UnKnown>" : lines[1],
|
Signer = lines[1],
|
||||||
Key = lines[2]
|
Key = lines[2]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,19 +37,19 @@ namespace SourceGit.Models
|
||||||
switch (VerifyResult)
|
switch (VerifyResult)
|
||||||
{
|
{
|
||||||
case 'G':
|
case 'G':
|
||||||
return $"Good signature.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Good signature.";
|
||||||
case 'B':
|
|
||||||
return $"Bad signature.\n\nSigner: {Signer}\n\nKey: {Key}";
|
|
||||||
case 'U':
|
case 'U':
|
||||||
return $"Good signature with unknown validity.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Good signature with unknown validity.";
|
||||||
case 'X':
|
case 'X':
|
||||||
return $"Good signature but has expired.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Good signature but has expired.";
|
||||||
case 'Y':
|
case 'Y':
|
||||||
return $"Good signature made by expired key.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Good signature made by expired key.";
|
||||||
case 'R':
|
case 'R':
|
||||||
return $"Good signature made by a revoked key.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Good signature made by a revoked key.";
|
||||||
|
case 'B':
|
||||||
|
return "Bad signature.";
|
||||||
case 'E':
|
case 'E':
|
||||||
return $"Signature cannot be checked.\n\nSigner: {Signer}\n\nKey: {Key}";
|
return "Signature cannot be checked.";
|
||||||
default:
|
default:
|
||||||
return "No signature.";
|
return "No signature.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,20 @@
|
||||||
|
|
||||||
<ContentControl.DataTemplates>
|
<ContentControl.DataTemplates>
|
||||||
<DataTemplate DataType="m:CommitSignInfo">
|
<DataTemplate DataType="m:CommitSignInfo">
|
||||||
<Border Width="24" Background="Transparent" ToolTip.Tip="{Binding ToolTip}">
|
<Border Width="24" Background="Transparent">
|
||||||
|
<ToolTip.Tip>
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
|
<TextBlock Margin="0,0,0,12" Text="{Binding ToolTip}"/>
|
||||||
|
<TextBlock Margin="0,0,0,2" IsVisible="{Binding Signer, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
||||||
|
<Run Text="Signer:"/>
|
||||||
|
<Run Text="{Binding Signer}"/>
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock>
|
||||||
|
<Run Text="KEY:"/>
|
||||||
|
<Run Text="{Binding Key}"/>
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</ToolTip.Tip>
|
||||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Verified}" Fill="{Binding Brush}"/>
|
<Path Width="14" Height="14" Data="{StaticResource Icons.Verified}" Fill="{Binding Brush}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
Loading…
Reference in a new issue