mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature: add a button to see which branches and tags that contains selected commit (#388)
This commit is contained in:
parent
fcc8a41ad1
commit
6ab0900b20
14 changed files with 171 additions and 18 deletions
|
@ -1,3 +1,5 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
|
@ -17,6 +19,15 @@ namespace SourceGit.Views
|
|||
set => SetValue(MessageProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<bool> SupportsContainsInProperty =
|
||||
AvaloniaProperty.Register<CommitBaseInfo, bool>(nameof(SupportsContainsIn));
|
||||
|
||||
public bool SupportsContainsIn
|
||||
{
|
||||
get => GetValue(SupportsContainsInProperty);
|
||||
set => SetValue(SupportsContainsInProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<AvaloniaList<Models.CommitLink>> WebLinksProperty =
|
||||
AvaloniaProperty.Register<CommitBaseInfo, AvaloniaList<Models.CommitLink>>(nameof(WebLinks));
|
||||
|
||||
|
@ -74,6 +85,19 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenContainsIn(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.CommitDetail detail && sender is Button button)
|
||||
{
|
||||
var tracking = new CommitRelationTracking(detail);
|
||||
var flyout = new Flyout();
|
||||
flyout.Content = tracking;
|
||||
flyout.ShowAt(button);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnParentSHAPressed(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue