mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
project: reorganize the structure of the project.
* remove dotnet-tool.json because the project does not rely on any dotnet tools. * remove Directory.Build.props because the solution has only one project. * move src/SourceGit to src. It's not needed to put all sources into a subfolder of src since there's only one project.
This commit is contained in:
parent
96e60da7ad
commit
96d4150d26
319 changed files with 37 additions and 53 deletions
61
src/Views/RevisionCompare.axaml.cs
Normal file
61
src/Views/RevisionCompare.axaml.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class RevisionCompare : UserControl
|
||||
{
|
||||
public RevisionCompare()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnDataGridSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is DataGrid datagrid && datagrid.IsVisible)
|
||||
{
|
||||
datagrid.ScrollIntoView(datagrid.SelectedItem, null);
|
||||
}
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnDataGridContextRequested(object sender, ContextRequestedEventArgs e)
|
||||
{
|
||||
if (sender is DataGrid datagrid && datagrid.SelectedItem != null)
|
||||
{
|
||||
var compare = DataContext as ViewModels.RevisionCompare;
|
||||
var menu = compare.CreateChangeContextMenu(datagrid.SelectedItem as Models.Change);
|
||||
menu.Open(datagrid);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnTreeViewContextRequested(object sender, ContextRequestedEventArgs e)
|
||||
{
|
||||
if (sender is TreeView view && view.SelectedItem != null)
|
||||
{
|
||||
var compare = DataContext as ViewModels.RevisionCompare;
|
||||
var node = view.SelectedItem as ViewModels.FileTreeNode;
|
||||
if (node != null && !node.IsFolder)
|
||||
{
|
||||
var menu = compare.CreateChangeContextMenu(node.Backend as Models.Change);
|
||||
menu.Open(view);
|
||||
}
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (sender is TextBlock block)
|
||||
{
|
||||
var compare = DataContext as ViewModels.RevisionCompare;
|
||||
compare.NavigateTo(block.Text);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue