feature: new way to display changes of submodules

This commit is contained in:
leo 2024-05-29 12:50:26 +08:00
parent 1161738df9
commit 69f9dceece
9 changed files with 92 additions and 12 deletions

View file

@ -1,3 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
@ -5,6 +6,15 @@ namespace SourceGit.Views
{
public partial class CommitBaseInfo : UserControl
{
public static readonly StyledProperty<bool> CanNavigateProperty =
AvaloniaProperty.Register<CommitBaseInfo, bool>(nameof(CanNavigate), true);
public bool CanNavigate
{
get => GetValue(CanNavigateProperty);
set => SetValue(CanNavigateProperty, value);
}
public CommitBaseInfo()
{
InitializeComponent();
@ -12,10 +22,9 @@ namespace SourceGit.Views
private void OnParentSHAPressed(object sender, PointerPressedEventArgs e)
{
if (DataContext is ViewModels.CommitDetail detail)
{
if (DataContext is ViewModels.CommitDetail detail && CanNavigate)
detail.NavigateTo((sender as Control).DataContext as string);
}
e.Handled = true;
}
}