File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
UniGetUI.Avalonia/Views/SoftwarePages
UniGetUI/Pages/SoftwarePages Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 33using Avalonia . Controls . ApplicationLifetimes ;
44using Avalonia . Input ;
55using Avalonia . Input . Platform ;
6+ using Avalonia . Threading ;
67using UniGetUI . Avalonia . ViewModels . Pages ;
78using UniGetUI . Avalonia . Views . Controls ;
89using UniGetUI . Core . Tools ;
@@ -86,7 +87,13 @@ or nameof(PackagesPageViewModel.SortAscending))
8687 // ─── UI-only: focus the package list ─────────────────────────────────────
8788 private void OnFocusListRequested ( ) => PackageList . Focus ( ) ;
8889
89- public void FocusPackageList ( ) => ViewModel . RequestFocusList ( ) ;
90+ public void FocusPackageList ( )
91+ {
92+ if ( ViewModel . MegaQueryBoxEnabled )
93+ Dispatcher . UIThread . Post ( ( ) => MegaQueryBlock . Focus ( ) , DispatcherPriority . Background ) ;
94+ else
95+ ViewModel . RequestFocusList ( ) ;
96+ }
9097 public void FilterPackages ( ) => ViewModel . FilterPackages ( ) ;
9198
9299 // ─── Abstract: let concrete pages add toolbar items ───────────────────────
Original file line number Diff line number Diff line change @@ -1294,7 +1294,14 @@ protected void PerformMainPackageAction(IPackage? package)
12941294 }
12951295 }
12961296
1297- public void FocusPackageList ( ) => CurrentPackageList . Focus ( FocusState . Programmatic ) ;
1297+ public void FocusPackageList ( )
1298+ {
1299+ if ( MEGA_QUERY_BOX_ENABLED )
1300+ DispatcherQueue . TryEnqueue ( DispatcherQueuePriority . Low ,
1301+ ( ) => MegaQueryBlock . Focus ( FocusState . Programmatic ) ) ;
1302+ else
1303+ CurrentPackageList . Focus ( FocusState . Programmatic ) ;
1304+ }
12981305
12991306 public async Task ShowContextMenu ( PackageWrapper wrapper )
13001307 {
You can’t perform that action at this time.
0 commit comments