mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
revert: disable double-click folding/unfolding because it will cause IndexOutOfRange exception
This commit is contained in:
parent
a382a3e564
commit
ea1bfad84d
6 changed files with 2 additions and 55 deletions
|
@ -513,13 +513,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
var selection = new Models.TreeDataGridSelectionModel<FileTreeNode>(source, x => x.Children);
|
||||
selection.SingleSelect = true;
|
||||
selection.RowDoubleTapped += (s, e) =>
|
||||
{
|
||||
var model = s as Models.TreeDataGridSelectionModel<FileTreeNode>;
|
||||
var node = model.SelectedItem;
|
||||
if (node != null && node.IsFolder)
|
||||
node.IsExpanded = !node.IsExpanded;
|
||||
};
|
||||
selection.SelectionChanged += (s, _) =>
|
||||
{
|
||||
if (s is Models.TreeDataGridSelectionModel<FileTreeNode> selection)
|
||||
|
|
|
@ -50,14 +50,7 @@
|
|||
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
||||
Changes="{Binding VisibleChanges}"
|
||||
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
||||
ContextRequested="OnChangeContextRequested"
|
||||
ChangeDoubleTapped="OnChangeDoubleTapped">
|
||||
<v:ChangeCollectionView.Styles>
|
||||
<Style Selector="TreeDataGridExpanderCell" x:DataType="vm:FileTreeNode">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
||||
</Style>
|
||||
</v:ChangeCollectionView.Styles>
|
||||
</v:ChangeCollectionView>
|
||||
ContextRequested="OnChangeContextRequested"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
|
@ -24,17 +23,5 @@ namespace SourceGit.Views
|
|||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnChangeDoubleTapped(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ChangeCollectionView view)
|
||||
{
|
||||
var selected = view.tree?.RowSelection?.SelectedItem as ViewModels.FileTreeNode;
|
||||
if (selected != null && selected.IsFolder)
|
||||
selected.IsExpanded = !selected.IsExpanded;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,14 +105,7 @@
|
|||
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
||||
Changes="{Binding VisibleChanges}"
|
||||
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
||||
ContextRequested="OnChangeContextRequested"
|
||||
ChangeDoubleTapped="OnChangeDoubleTapped">
|
||||
<v:ChangeCollectionView.Styles>
|
||||
<Style Selector="TreeDataGridExpanderCell" x:DataType="vm:FileTreeNode">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
||||
</Style>
|
||||
</v:ChangeCollectionView.Styles>
|
||||
</v:ChangeCollectionView>
|
||||
ContextRequested="OnChangeContextRequested"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
|
@ -22,18 +21,6 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnChangeDoubleTapped(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ChangeCollectionView view)
|
||||
{
|
||||
var selected = view.tree?.RowSelection?.SelectedItem as ViewModels.FileTreeNode;
|
||||
if (selected != null && selected.IsFolder)
|
||||
selected.IsExpanded = !selected.IsExpanded;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.RevisionCompare vm && sender is TextBlock block)
|
||||
|
|
|
@ -56,12 +56,6 @@
|
|||
</Grid>
|
||||
</DataTemplate>
|
||||
</TreeDataGrid.Resources>
|
||||
|
||||
<TreeDataGrid.Styles>
|
||||
<Style Selector="TreeDataGridExpanderCell" x:DataType="vm:FileTreeNode">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
||||
</Style>
|
||||
</TreeDataGrid.Styles>
|
||||
</TreeDataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in a new issue