File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 8
8
using Avalonia . Platform . Storage ;
9
9
using FluentAvalonia . UI . Controls ;
10
10
using MsBox . Avalonia ;
11
- using SkiaSharp ;
12
11
13
12
namespace UnityHubNative . Net ;
14
13
@@ -60,6 +59,14 @@ protected override void OnKeyDown(KeyEventArgs e)
60
59
61
60
if ( s_tabControl . SelectedIndex == 0 )
62
61
{
62
+ // try open project
63
+ if ( e . Key == Key . Enter && TryGetSelectedProject ( out var unityProject ) )
64
+ {
65
+ OpenSelectedProject ( ) ;
66
+ e . Handled = true ;
67
+ return ;
68
+ }
69
+
63
70
// focus on searchbar if typed a character
64
71
if ( e . KeyModifiers is KeyModifiers . None or KeyModifiers . Shift && ( int ) e . Key >= ( int ) Key . A && ( int ) e . Key <= ( int ) Key . Z )
65
72
{
@@ -289,7 +296,7 @@ public static void MoveSelectedProjectDown()
289
296
WrapSelection = true ,
290
297
SelectionMode = SelectionMode . AlwaysSelected | SelectionMode . Single ,
291
298
SelectedIndex = 0 ,
292
- } . OnSelectionChanged ( UnityProjectSelectedIndexChanged )
299
+ } . AddOnSubmit ( OpenSelectedProject ) . OnSelectionChanged ( UnityProjectSelectedIndexChanged )
293
300
} ,
294
301
] ) ,
295
302
] )
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class SubmitableListBox : ListBox
26
26
protected override void OnPointerReleased ( PointerReleasedEventArgs e )
27
27
{
28
28
base . OnPointerReleased ( e ) ;
29
- if ( ! e . Handled && e . InitialPressMouseButton == MouseButton . Left )
29
+ if ( e . InitialPressMouseButton == MouseButton . Left )
30
30
{
31
31
OnSubmit ? . Invoke ( ) ;
32
32
e . Handled = true ;
Original file line number Diff line number Diff line change @@ -290,9 +290,7 @@ public void OpenProject(UnityPlatform platform = UnityPlatform.CurrentPlatform)
290
290
}
291
291
292
292
if ( UnityHubNativeNetApp . Config . closeAfterProjectOpen )
293
- {
294
293
MainWindow . Instance . Close ( ) ;
295
- }
296
294
}
297
295
298
296
}
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public UnityProjectView() : base()
69
69
70
70
private void OnPathLinkClicked ( ) => OsUtils . OpenExplorer ( unityProject . path ) ;
71
71
72
- public async void OpenProject ( )
72
+ public void OpenProject ( )
73
73
{
74
74
if ( unityProject is null )
75
75
return ;
You can’t perform that action at this time.
0 commit comments