mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-02 01:34:58 +00:00
enhance: show commit full message tooltip when hover commit subject in FileHistories
view (#1232)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
7890f7abbf
commit
fafa2a53ae
3 changed files with 37 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
@ -57,5 +59,22 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCommitSubjectDataContextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sender is TextBlock textBlock)
|
||||
ToolTip.SetTip(textBlock, null);
|
||||
}
|
||||
|
||||
private void OnCommitSubjectPointerMoved(object sender, PointerEventArgs e)
|
||||
{
|
||||
if (sender is TextBlock { DataContext: Models.Commit commit } textBlock &&
|
||||
DataContext is ViewModels.FileHistories vm)
|
||||
{
|
||||
var tooltip = ToolTip.GetTip(textBlock);
|
||||
if (tooltip == null)
|
||||
ToolTip.SetTip(textBlock, vm.GetCommitFullMessage(commit));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue