DoubleTab Open Submodule

This commit is contained in:
Enner Pérez 2024-06-19 13:24:54 -05:00
parent 033fbc6383
commit 46b1fc1831
2 changed files with 12 additions and 0 deletions

View file

@ -457,6 +457,7 @@
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
ContextRequested="OnSubmoduleContextRequested" ContextRequested="OnSubmoduleContextRequested"
DoubleTapped="OnDoubleTappedSubmodule"
IsVisible="{Binding IsSubmoduleGroupExpanded, Mode=OneWay}"> IsVisible="{Binding IsSubmoduleGroupExpanded, Mode=OneWay}">
<DataGrid.Styles> <DataGrid.Styles>
<Style Selector="DataGridRow"> <Style Selector="DataGridRow">

View file

@ -332,5 +332,16 @@ namespace SourceGit.Views
outs.Add(b); outs.Add(b);
} }
} }
private void OnDoubleTappedSubmodule(object sender, TappedEventArgs e)
{
if (sender is DataGrid datagrid && datagrid.SelectedItem != null && DataContext is ViewModels.Repository repo)
{
var submodule = datagrid.SelectedItem as string;
(DataContext as ViewModels.Repository).OpenSubmodule(submodule);
}
e.Handled = true;
}
} }
} }