mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
fix: tooltip of commit sha did not close properly (#810)
This commit is contained in:
parent
0ac1031c4c
commit
27afe1871f
2 changed files with 12 additions and 14 deletions
|
@ -112,7 +112,8 @@
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Margin="0,0,16,0"
|
Margin="0,0,16,0"
|
||||||
PointerEntered="OnSHAPointerEntered"
|
PointerEntered="OnSHAPointerEntered"
|
||||||
PointerPressed="OnSHAPressed">
|
PointerPressed="OnSHAPressed"
|
||||||
|
ToolTip.ShowDelay="0">
|
||||||
<TextBlock.DataTemplates>
|
<TextBlock.DataTemplates>
|
||||||
<DataTemplate DataType="m:Commit">
|
<DataTemplate DataType="m:Commit">
|
||||||
<StackPanel MinWidth="400" Orientation="Vertical">
|
<StackPanel MinWidth="400" Orientation="Vertical">
|
||||||
|
@ -149,7 +150,8 @@
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Margin="0,0,16,0"
|
Margin="0,0,16,0"
|
||||||
PointerEntered="OnSHAPointerEntered"
|
PointerEntered="OnSHAPointerEntered"
|
||||||
PointerPressed="OnSHAPressed">
|
PointerPressed="OnSHAPressed"
|
||||||
|
ToolTip.ShowDelay="0">
|
||||||
<TextBlock.DataTemplates>
|
<TextBlock.DataTemplates>
|
||||||
<DataTemplate DataType="m:Commit">
|
<DataTemplate DataType="m:Commit">
|
||||||
<StackPanel MinWidth="400" Orientation="Vertical">
|
<StackPanel MinWidth="400" Orientation="Vertical">
|
||||||
|
|
|
@ -130,19 +130,15 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
var tooltip = ToolTip.GetTip(ctl);
|
var tooltip = ToolTip.GetTip(ctl);
|
||||||
if (tooltip is Models.Commit commit && commit.SHA == sha)
|
if (tooltip is Models.Commit commit && commit.SHA == sha)
|
||||||
{
|
return;
|
||||||
ToolTip.SetIsOpen(ctl, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var c = await Task.Run(() => detail.GetParent(sha));
|
|
||||||
if (c != null && ctl.IsVisible && ctl.DataContext is string newSHA && newSHA == sha)
|
|
||||||
{
|
|
||||||
ToolTip.SetTip(ctl, c);
|
|
||||||
|
|
||||||
if (ctl.IsPointerOver)
|
var c = await Task.Run(() => detail.GetParent(sha));
|
||||||
ToolTip.SetIsOpen(ctl, true);
|
if (c != null && ctl.IsVisible && ctl.DataContext is string newSHA && newSHA == sha)
|
||||||
}
|
{
|
||||||
|
ToolTip.SetTip(ctl, c);
|
||||||
|
|
||||||
|
if (ctl.IsPointerOver)
|
||||||
|
ToolTip.SetIsOpen(ctl, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue