为历史记录的 INFORMATION Tab页中的 CHANGE 增加双击打开文件历史

This commit is contained in:
ZCShou 2020-07-14 09:14:02 +08:00
parent 689b02cd61
commit f8bb65ce47
2 changed files with 14 additions and 0 deletions

View file

@ -211,6 +211,7 @@
<DataGrid.RowStyle> <DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}"> <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource Style.DataGridRow}">
<EventSetter Event="ContextMenuOpening" Handler="ChangeListContextMenuOpening"/> <EventSetter Event="ContextMenuOpening" Handler="ChangeListContextMenuOpening"/>
<EventSetter Event="MouseDoubleClick" Handler="ChangeListMouseDoubleClick"/>
</Style> </Style>
</DataGrid.RowStyle> </DataGrid.RowStyle>
</DataGrid> </DataGrid>

View file

@ -280,6 +280,18 @@ namespace SourceGit.UI {
menu.IsOpen = true; menu.IsOpen = true;
e.Handled = true; e.Handled = true;
} }
private void ChangeListMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var row = sender as DataGridRow;
if (row == null) return;
var change = row.DataContext as Git.Change;
if (change == null) return;
var viewer = new FileHistories(repo, change.Path);
viewer.Show();
}
#endregion #endregion
#region FILES #region FILES
@ -466,5 +478,6 @@ namespace SourceGit.UI {
e.Handled = true; e.Handled = true;
} }
#endregion #endregion
} }
} }