diff --git a/src/Views/Blame.axaml b/src/Views/Blame.axaml
index eaad985a..7a3d7ddf 100644
--- a/src/Views/Blame.axaml
+++ b/src/Views/Blame.axaml
@@ -59,7 +59,14 @@
FontFamily="{DynamicResource Fonts.Monospace}"
FontSize="{Binding Source={x:Static vm:Preferences.Instance}, Path=EditorFontSize}"
TabWidth="{Binding Source={x:Static vm:Preferences.Instance}, Path=EditorTabWidth}"
- BlameData="{Binding Data}"/>
+ BlameData="{Binding Data}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -152,6 +159,13 @@
PointerEntered="OnSHAPointerEntered"
PointerPressed="OnSHAPressed"
ToolTip.ShowDelay="0">
+
+
+
+
+
+
+
diff --git a/src/Views/CommitBaseInfo.axaml.cs b/src/Views/CommitBaseInfo.axaml.cs
index 8767db9f..ac9b53cc 100644
--- a/src/Views/CommitBaseInfo.axaml.cs
+++ b/src/Views/CommitBaseInfo.axaml.cs
@@ -133,12 +133,7 @@ namespace SourceGit.Views
Dispatcher.UIThread.Invoke(() =>
{
if (ctl.IsEffectivelyVisible && ctl.DataContext is string newSHA && newSHA == sha)
- {
ToolTip.SetTip(ctl, c);
-
- if (ctl.IsPointerOver)
- ToolTip.SetIsOpen(ctl, true);
- }
});
});
}
diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs
index 002beda1..6f838509 100644
--- a/src/Views/CommitMessagePresenter.cs
+++ b/src/Views/CommitMessagePresenter.cs
@@ -5,6 +5,8 @@ using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Documents;
+using Avalonia.Data;
+using Avalonia.Data.Converters;
using Avalonia.Input;
using Avalonia.Threading;
using Avalonia.VisualTree;
@@ -24,6 +26,21 @@ namespace SourceGit.Views
protected override Type StyleKeyOverride => typeof(SelectableTextBlock);
+ public CommitMessagePresenter()
+ {
+ var bindings = new MultiBinding()
+ {
+ Converter = BoolConverters.And,
+ Bindings = new[]
+ {
+ new Binding() { Path = "IsPointerOver", Source = this },
+ new Binding() { Path = "(ToolTip.Tip)", Source = this, TypeResolver = (_, name) => name == "ToolTip" ? typeof(ToolTip) : null, Converter = ObjectConverters.IsNotNull },
+ }
+ };
+
+ Bind(ToolTip.IsOpenProperty, bindings);
+ }
+
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
@@ -107,14 +124,9 @@ namespace SourceGit.Views
_lastHover = link;
if (!link.IsCommitSHA)
- {
ToolTip.SetTip(this, link.Link);
- ToolTip.SetIsOpen(this, true);
- }
else
- {
ProcessHoverCommitLink(link);
- }
return;
}
@@ -264,12 +276,7 @@ namespace SourceGit.Views
// If we have already queried this SHA, just use it.
if (_inlineCommits.TryGetValue(sha, out var exist))
{
- if (exist != null)
- {
- ToolTip.SetTip(this, exist);
- ToolTip.SetIsOpen(this, true);
- }
-
+ ToolTip.SetTip(this, exist);
return;
}
@@ -294,10 +301,7 @@ namespace SourceGit.Views
// Make sure user still hovers the target SHA.
if (_lastHover == link && c != null)
- {
ToolTip.SetTip(this, c);
- ToolTip.SetIsOpen(this, true);
- }
}
});
});
diff --git a/src/Views/CommitSubjectPresenter.cs b/src/Views/CommitSubjectPresenter.cs
index 32f6838d..83d79fe4 100644
--- a/src/Views/CommitSubjectPresenter.cs
+++ b/src/Views/CommitSubjectPresenter.cs
@@ -144,7 +144,6 @@ namespace SourceGit.Views
_lastHover = match;
SetCurrentValue(CursorProperty, Cursor.Parse("Hand"));
ToolTip.SetTip(this, match.Link);
- ToolTip.SetIsOpen(this, true);
e.Handled = true;
return;
}