mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-24 11:54:59 +00:00
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:
parent
750c2738c2
commit
9f1d3ecdb5
1 changed files with 7 additions and 1 deletions
|
@ -7,6 +7,7 @@ using Avalonia.Collections;
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Documents;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace SourceGit.Views
|
||||
|
@ -149,11 +150,16 @@ namespace SourceGit.Views
|
|||
SetCurrentValue(CursorProperty, Cursor.Parse("Hand"));
|
||||
|
||||
_lastHover = match;
|
||||
if (!_lastHover.IsCommitSHA)
|
||||
if (!match.IsCommitSHA)
|
||||
{
|
||||
ToolTip.SetTip(this, match.Link);
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue