File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change 4
4
using Avalonia . Controls . Primitives ;
5
5
using Avalonia . Input ;
6
6
using Avalonia . Interactivity ;
7
- using Avalonia . VisualTree ;
8
7
9
8
namespace SourceGit . Views
10
9
{
@@ -16,9 +15,7 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
16
15
{
17
16
if ( e . GetCurrentPoint ( this ) . Properties . IsLeftButtonPressed &&
18
17
DataContext is ViewModels . RepositoryNode { IsRepository : false } node )
19
- {
20
18
ViewModels . Welcome . Instance . ToggleNodeIsExpanded ( node ) ;
21
- }
22
19
23
20
e . Handled = true ;
24
21
}
@@ -41,10 +38,7 @@ protected override void OnKeyDown(KeyEventArgs e)
41
38
{
42
39
if ( e . Key == Key . Enter )
43
40
{
44
- var parent = this . FindAncestorOfType < Launcher > ( ) ;
45
- if ( parent is { DataContext : ViewModels . Launcher launcher } )
46
- launcher . OpenRepositoryInTab ( node , null ) ;
47
-
41
+ node . Open ( ) ;
48
42
e . Handled = true ;
49
43
}
50
44
}
@@ -376,15 +370,9 @@ private void OnDoubleTappedTreeNode(object sender, TappedEventArgs e)
376
370
if ( sender is Grid { DataContext : ViewModels . RepositoryNode node } )
377
371
{
378
372
if ( node . IsRepository )
379
- {
380
- var parent = this . FindAncestorOfType < Launcher > ( ) ;
381
- if ( parent is { DataContext : ViewModels . Launcher launcher } )
382
- launcher . OpenRepositoryInTab ( node , null ) ;
383
- }
373
+ node . Open ( ) ;
384
374
else
385
- {
386
375
ViewModels . Welcome . Instance . ToggleNodeIsExpanded ( node ) ;
387
- }
388
376
389
377
e . Handled = true ;
390
378
}
You can’t perform that action at this time.
0 commit comments