mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 13:45:00 +00:00
ux: use a outer border to hold tooltip of commit message in FileHistories
view (#1232)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
f09367a614
commit
d44d2b9770
2 changed files with 8 additions and 11 deletions
|
@ -93,12 +93,9 @@
|
||||||
<TextBlock Grid.Column="3" Classes="primary" Text="{Binding AuthorTimeShortStr}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/>
|
<TextBlock Grid.Column="3" Classes="primary" Text="{Binding AuthorTimeShortStr}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1"
|
<Border Grid.Row="1" Background="Transparent" DataContextChanged="OnCommitSubjectDataContextChanged" PointerMoved="OnCommitSubjectPointerMoved">
|
||||||
Classes="primary"
|
<TextBlock Classes="primary" Text="{Binding Subject}" VerticalAlignment="Bottom"/>
|
||||||
Text="{Binding Subject}"
|
</Border>
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
DataContextChanged="OnCommitSubjectDataContextChanged"
|
|
||||||
PointerMoved="OnCommitSubjectPointerMoved"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
|
@ -62,18 +62,18 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
private void OnCommitSubjectDataContextChanged(object sender, EventArgs e)
|
private void OnCommitSubjectDataContextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is TextBlock textBlock)
|
if (sender is Border border)
|
||||||
ToolTip.SetTip(textBlock, null);
|
ToolTip.SetTip(border, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCommitSubjectPointerMoved(object sender, PointerEventArgs e)
|
private void OnCommitSubjectPointerMoved(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is TextBlock { DataContext: Models.Commit commit } textBlock &&
|
if (sender is Border { DataContext: Models.Commit commit } border &&
|
||||||
DataContext is ViewModels.FileHistories vm)
|
DataContext is ViewModels.FileHistories vm)
|
||||||
{
|
{
|
||||||
var tooltip = ToolTip.GetTip(textBlock);
|
var tooltip = ToolTip.GetTip(border);
|
||||||
if (tooltip == null)
|
if (tooltip == null)
|
||||||
ToolTip.SetTip(textBlock, vm.GetCommitFullMessage(commit));
|
ToolTip.SetTip(border, vm.GetCommitFullMessage(commit));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue