mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08: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);
|
var selection = new Models.TreeDataGridSelectionModel<FileTreeNode>(source, x => x.Children);
|
||||||
selection.SingleSelect = true;
|
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, _) =>
|
selection.SelectionChanged += (s, _) =>
|
||||||
{
|
{
|
||||||
if (s is Models.TreeDataGridSelectionModel<FileTreeNode> selection)
|
if (s is Models.TreeDataGridSelectionModel<FileTreeNode> selection)
|
||||||
|
|
|
@ -50,14 +50,7 @@
|
||||||
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
||||||
Changes="{Binding VisibleChanges}"
|
Changes="{Binding VisibleChanges}"
|
||||||
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
||||||
ContextRequested="OnChangeContextRequested"
|
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>
|
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
|
||||||
|
|
||||||
namespace SourceGit.Views
|
namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
|
@ -24,17 +23,5 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
e.Handled = true;
|
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}"
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
||||||
Changes="{Binding VisibleChanges}"
|
Changes="{Binding VisibleChanges}"
|
||||||
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
||||||
ContextRequested="OnChangeContextRequested"
|
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>
|
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
|
||||||
|
|
||||||
namespace SourceGit.Views
|
namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
|
@ -22,18 +21,6 @@ namespace SourceGit.Views
|
||||||
e.Handled = true;
|
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)
|
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
if (DataContext is ViewModels.RevisionCompare vm && sender is TextBlock block)
|
if (DataContext is ViewModels.RevisionCompare vm && sender is TextBlock block)
|
||||||
|
|
|
@ -56,12 +56,6 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</TreeDataGrid.Resources>
|
</TreeDataGrid.Resources>
|
||||||
|
|
||||||
<TreeDataGrid.Styles>
|
|
||||||
<Style Selector="TreeDataGridExpanderCell" x:DataType="vm:FileTreeNode">
|
|
||||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
|
||||||
</Style>
|
|
||||||
</TreeDataGrid.Styles>
|
|
||||||
</TreeDataGrid>
|
</TreeDataGrid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in a new issue