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 11
11
12
12
namespace UnityHubNative . Net ;
13
13
14
- class MainWindow : Window
14
+ sealed class MainWindow : Window
15
15
{
16
16
const string InstallUnityUrl = "https://unity.com/releases/editor/archive" ;
17
17
@@ -99,7 +99,7 @@ protected override void OnOpened(EventArgs e)
99
99
{
100
100
base . OnOpened ( e ) ;
101
101
if ( s_unityProjectsParent . SelectedItem != null )
102
- s_unityProjectsParent . ContainerFromIndex ( 0 ) ! . Focus ( ) ;
102
+ s_unityProjectsParent . ContainerFromIndex ( s_unityInstallationsParent . SelectedIndex ) ! . Focus ( ) ;
103
103
}
104
104
105
105
public static void ReloadEverything ( )
Original file line number Diff line number Diff line change
1
+ using System . Diagnostics ;
1
2
using Avalonia . Controls ;
2
3
using Avalonia . Input ;
3
4
4
5
namespace UnityHubNative . Net ;
5
6
6
- class SubmitableListBox : ListBox
7
+ sealed class SubmitableListBox : ListBox
7
8
{
8
9
static readonly KeyGesture [ ] DefaultSubmitGesture =
9
10
[
@@ -23,6 +24,8 @@ class SubmitableListBox : ListBox
23
24
24
25
protected override Type StyleKeyOverride => typeof ( ListBox ) ;
25
26
27
+ private bool _firstTime = true ;
28
+
26
29
protected override void OnPointerReleased ( PointerReleasedEventArgs e )
27
30
{
28
31
base . OnPointerReleased ( e ) ;
@@ -42,7 +45,18 @@ protected override void OnKeyDown(KeyEventArgs e)
42
45
e . Handled = true ;
43
46
return ;
44
47
}
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 ) ;
46
60
}
47
61
48
62
public SubmitableListBox AddOnSubmit ( Action callback )
Original file line number Diff line number Diff line change 35
35
</PropertyGroup >
36
36
37
37
<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" />
40
40
<PackageReference Include =" FluentAvaloniaUI" Version =" 2.4.0-preview1" />
41
41
<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" />
43
43
<!-- <PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.4" />-->
44
44
<!-- <PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.5" />-->
45
45
<!-- <PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.4" />-->
62
62
<AvaloniaXamlIlDebuggerLaunch >False</AvaloniaXamlIlDebuggerLaunch >
63
63
<AvaloniaXamlReportImportance >Normal</AvaloniaXamlReportImportance >
64
64
</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 >
65
73
</Project >
Original file line number Diff line number Diff line change 9
9
<AssemblyName >UnityHubNative.Net</AssemblyName >
10
10
<DefineConstants >$(DefineConstants);OS_WINDOWS</DefineConstants >
11
11
<ApplicationIcon >res/icon.ico</ApplicationIcon >
12
+ <ProduceReferenceAssembly >False</ProduceReferenceAssembly >
12
13
</PropertyGroup >
13
14
14
15
<!-- for optimization-->
24
25
<PropertyGroup Label =" Avalonia" >
25
26
<AvaloniaNameGeneratorAttachDevTools >True</AvaloniaNameGeneratorAttachDevTools >
26
27
<SupportedOSPlatformVersion >10.0.17763.0</SupportedOSPlatformVersion >
28
+ <PlatformTarget >x64</PlatformTarget >
27
29
</PropertyGroup >
28
30
29
31
<ItemGroup >
You can’t perform that action at this time.
0 commit comments