From 9f1d3ecdb50d0380e563aa7a6b6a3bc107b1c007 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 24 Nov 2024 00:19:34 +0100 Subject: [PATCH] feat: show commit tooltip as well `_lastHover` in the `if` is also swapped for `match`for consistency with the block body --- src/Views/CommitMessagePresenter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 67b3065d..c4da7e94 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -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() is { DataContext: ViewModels.CommitDetail detail } && detail.GetParent(match.Link) is Models.Commit c) + { + ToolTip.SetTip(this, c); + ToolTip.SetIsOpen(this, true); + } return; }