feat: show commit tooltip as well

`_lastHover` in the `if` is also swapped for `match`for consistency with the block body
This commit is contained in:
Dmitrij D. Czarkoff 2024-11-24 00:19:34 +01:00
parent 750c2738c2
commit 9f1d3ecdb5
No known key found for this signature in database

View file

@ -7,6 +7,7 @@ using Avalonia.Collections;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Documents; using Avalonia.Controls.Documents;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Platform.Storage;
using Avalonia.VisualTree; using Avalonia.VisualTree;
namespace SourceGit.Views namespace SourceGit.Views
@ -149,11 +150,16 @@ namespace SourceGit.Views
SetCurrentValue(CursorProperty, Cursor.Parse("Hand")); SetCurrentValue(CursorProperty, Cursor.Parse("Hand"));
_lastHover = match; _lastHover = match;
if (!_lastHover.IsCommitSHA) if (!match.IsCommitSHA)
{ {
ToolTip.SetTip(this, match.Link); ToolTip.SetTip(this, match.Link);
ToolTip.SetIsOpen(this, true); ToolTip.SetIsOpen(this, true);
} }
else if (this.FindAncestorOfType<CommitBaseInfo>() is { DataContext: ViewModels.CommitDetail detail } && detail.GetParent(match.Link) is Models.Commit c)
{
ToolTip.SetTip(this, c);
ToolTip.SetIsOpen(this, true);
}
return; return;
} }