Skip to content

Commit 1953251

Browse files
committed
ux: tooltip of commit signing status icon
* do NOT show signer if it is not available * new tooltip style Signed-off-by: leo <[email protected]>
1 parent 4e87b25 commit 1953251

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

src/Commands/QueryCommitSignInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Models.CommitSignInfo Result()
2626
return new Models.CommitSignInfo()
2727
{
2828
VerifyResult = lines[0][0],
29-
Signer = string.IsNullOrEmpty(lines[1]) ? "<UnKnown>" : lines[1],
29+
Signer = lines[1],
3030
Key = lines[2]
3131
};
3232

src/Models/CommitSignInfo.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ public string ToolTip
3737
switch (VerifyResult)
3838
{
3939
case 'G':
40-
return $"Good signature.\n\nSigner: {Signer}\n\nKey: {Key}";
41-
case 'B':
42-
return $"Bad signature.\n\nSigner: {Signer}\n\nKey: {Key}";
40+
return "Good signature.";
4341
case 'U':
44-
return $"Good signature with unknown validity.\n\nSigner: {Signer}\n\nKey: {Key}";
42+
return "Good signature with unknown validity.";
4543
case 'X':
46-
return $"Good signature but has expired.\n\nSigner: {Signer}\n\nKey: {Key}";
44+
return "Good signature but has expired.";
4745
case 'Y':
48-
return $"Good signature made by expired key.\n\nSigner: {Signer}\n\nKey: {Key}";
46+
return "Good signature made by expired key.";
4947
case 'R':
50-
return $"Good signature made by a revoked key.\n\nSigner: {Signer}\n\nKey: {Key}";
48+
return "Good signature made by a revoked key.";
49+
case 'B':
50+
return "Bad signature.";
5151
case 'E':
52-
return $"Signature cannot be checked.\n\nSigner: {Signer}\n\nKey: {Key}";
52+
return "Signature cannot be checked.";
5353
default:
5454
return "No signature.";
5555
}

src/Views/CommitBaseInfo.axaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,20 @@
8181

8282
<ContentControl.DataTemplates>
8383
<DataTemplate DataType="m:CommitSignInfo">
84-
<Border Width="24" Background="Transparent" ToolTip.Tip="{Binding ToolTip}">
84+
<Border Width="24" Background="Transparent">
85+
<ToolTip.Tip>
86+
<StackPanel Orientation="Vertical">
87+
<TextBlock Margin="0,0,0,12" Text="{Binding ToolTip}"/>
88+
<TextBlock Margin="0,0,0,2" IsVisible="{Binding Signer, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
89+
<Run Text="Signer:"/>
90+
<Run Text="{Binding Signer}"/>
91+
</TextBlock>
92+
<TextBlock>
93+
<Run Text="KEY:"/>
94+
<Run Text="{Binding Key}"/>
95+
</TextBlock>
96+
</StackPanel>
97+
</ToolTip.Tip>
8598
<Path Width="14" Height="14" Data="{StaticResource Icons.Verified}" Fill="{Binding Brush}"/>
8699
</Border>
87100
</DataTemplate>

0 commit comments

Comments
 (0)