mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature: new way to display changes of submodules
This commit is contained in:
parent
1161738df9
commit
69f9dceece
9 changed files with 92 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue