File tree Expand file tree Collapse file tree 4 files changed +31
-7
lines changed
Expand file tree Collapse file tree 4 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 1111
1212namespace UnityHubNative . Net ;
1313
14- class MainWindow : Window
14+ sealed class MainWindow : Window
1515{
1616 const string InstallUnityUrl = "https://unity.com/releases/editor/archive" ;
1717
@@ -99,7 +99,7 @@ protected override void OnOpened(EventArgs e)
9999 {
100100 base . OnOpened ( e ) ;
101101 if ( s_unityProjectsParent . SelectedItem != null )
102- s_unityProjectsParent . ContainerFromIndex ( 0 ) ! . Focus ( ) ;
102+ s_unityProjectsParent . ContainerFromIndex ( s_unityInstallationsParent . SelectedIndex ) ! . Focus ( ) ;
103103 }
104104
105105 public static void ReloadEverything ( )
Original file line number Diff line number Diff line change 1+ using System . Diagnostics ;
12using Avalonia . Controls ;
23using Avalonia . Input ;
34
45namespace UnityHubNative . Net ;
56
6- class SubmitableListBox : ListBox
7+ sealed class SubmitableListBox : ListBox
78{
89 static readonly KeyGesture [ ] DefaultSubmitGesture =
910 [
@@ -23,6 +24,8 @@ class SubmitableListBox : ListBox
2324
2425 protected override Type StyleKeyOverride => typeof ( ListBox ) ;
2526
27+ private bool _firstTime = true ;
28+
2629 protected override void OnPointerReleased ( PointerReleasedEventArgs e )
2730 {
2831 base . OnPointerReleased ( e ) ;
@@ -42,7 +45,18 @@ protected override void OnKeyDown(KeyEventArgs e)
4245 e . Handled = true ;
4346 return ;
4447 }
45- base . OnKeyDown ( e ) ;
48+ if ( _firstTime )
49+ {
50+ _firstTime = false ;
51+ var lastSelectedIndex = SelectedIndex ;
52+ base . OnKeyDown ( e ) ;
53+ if ( SelectedIndex == 1 )
54+ SelectedIndex = lastSelectedIndex + 1 ;
55+ else if ( SelectedIndex == ItemCount - 1 )
56+ SelectedIndex = lastSelectedIndex == 0 ? ItemCount - 1 : lastSelectedIndex - 1 ;
57+ }
58+ else
59+ base . OnKeyDown ( e ) ;
4660 }
4761
4862 public SubmitableListBox AddOnSubmit ( Action callback )
Original file line number Diff line number Diff line change 3535 </PropertyGroup >
3636
3737 <ItemGroup >
38- <PackageReference Include =" Avalonia" Version =" 11.3.0-beta1 " />
39- <PackageReference Include =" Avalonia.Desktop" Version =" 11.3.0-beta1 " />
38+ <PackageReference Include =" Avalonia" Version =" 11.3.0" />
39+ <PackageReference Include =" Avalonia.Desktop" Version =" 11.3.0" />
4040 <PackageReference Include =" FluentAvaloniaUI" Version =" 2.4.0-preview1" />
4141 <PackageReference Include =" MessageBox.Avalonia" Version =" 3.2.0" />
42- <PackageReference Condition =" '$(Configuration)' == 'Debug'" Include =" Avalonia.Diagnostics" Version =" 11.3.0-beta1 " />
42+ <PackageReference Condition =" '$(Configuration)' == 'Debug'" Include =" Avalonia.Diagnostics" Version =" 11.3.0" />
4343 <!-- <PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.4" />-->
4444 <!-- <PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.5" />-->
4545 <!-- <PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.4" />-->
6262 <AvaloniaXamlIlDebuggerLaunch >False</AvaloniaXamlIlDebuggerLaunch >
6363 <AvaloniaXamlReportImportance >Normal</AvaloniaXamlReportImportance >
6464 </PropertyGroup >
65+
66+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|AnyCPU'" >
67+ <IsAotCompatible >True</IsAotCompatible >
68+ </PropertyGroup >
69+
70+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Release|AnyCPU'" >
71+ <IsAotCompatible >True</IsAotCompatible >
72+ </PropertyGroup >
6573</Project >
Original file line number Diff line number Diff line change 99 <AssemblyName >UnityHubNative.Net</AssemblyName >
1010 <DefineConstants >$(DefineConstants);OS_WINDOWS</DefineConstants >
1111 <ApplicationIcon >res/icon.ico</ApplicationIcon >
12+ <ProduceReferenceAssembly >False</ProduceReferenceAssembly >
1213 </PropertyGroup >
1314
1415 <!-- for optimization-->
2425 <PropertyGroup Label =" Avalonia" >
2526 <AvaloniaNameGeneratorAttachDevTools >True</AvaloniaNameGeneratorAttachDevTools >
2627 <SupportedOSPlatformVersion >10.0.17763.0</SupportedOSPlatformVersion >
28+ <PlatformTarget >x64</PlatformTarget >
2729 </PropertyGroup >
2830
2931 <ItemGroup >
You can’t perform that action at this time.
0 commit comments