CPKreuz 3 년 전
부모
커밋
9600a75edc

+ 1 - 1
PixiEditor/ViewModels/SubViewModels/Main/FileViewModel.cs

@@ -110,7 +110,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             }
         }
 
-        [Command.Basic("PixiEditor.File.Open", "Open", "Open image", Key = Key.O, Modifiers = ModifierKeys.Control)]
+        [Command.Basic("PixiEditor.File.Open", "Open", "Open file", Key = Key.O, Modifiers = ModifierKeys.Control)]
         public void Open(string path)
         {
             if (path == null)

+ 1 - 1
PixiEditor/Views/UserControls/CommandSearch/CommandSearchControl.xaml

@@ -42,7 +42,7 @@
                 <TextBlock Text="{Binding Warnings, ElementName=uc}" TextAlignment="Center" Foreground="Gray" Margin="0,5,0,0"
                            Visibility="{Binding HasWarnings, Converter={BoolToVisibilityConverter}, ElementName=uc}"/>
                 <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
-                    <ItemsControl ItemsSource="{Binding Results, ElementName=uc}">
+                    <ItemsControl ItemsSource="{Binding Results, ElementName=uc}" x:Name="itemscontrol">
                         <ItemsControl.ItemTemplate>
                             <DataTemplate DataType="cmdssearch:SearchResult">
                                 <Button Padding="5" Height="40" BorderThickness="0" Background="Transparent"

+ 1 - 0
PixiEditor/Views/UserControls/CommandSearch/CommandSearchControl.xaml.cs

@@ -188,6 +188,7 @@ public partial class CommandSearchControl : UserControl, INotifyPropertyChanged
         newIndex = (newIndex % Results.Count + Results.Count) % Results.Count;
 
         SelectedResult = delta > 0 ? Results.IndexOrNext(x => x.CanExecute, newIndex) : Results.IndexOrPrevious(x => x.CanExecute, newIndex);
+        (itemscontrol.ItemContainerGenerator.ContainerFromIndex(newIndex) as FrameworkElement)?.BringIntoView();
     }
 
     private void Button_MouseMove(object sender, MouseEventArgs e)

+ 10 - 3
PixiEditor/Views/UserControls/CommandSearch/CommandSearchControlHelper.cs

@@ -54,15 +54,22 @@ internal static class CommandSearchControlHelper
                 .Where(x => x.Description.Contains(query, StringComparison.OrdinalIgnoreCase))
                 .Where(static x => ViewModelMain.Current.DebugSubViewModel.UseDebug ? true : !x.IsDebug)
                 .OrderByDescending(x => x.Description.Contains($" {query} ", StringComparison.OrdinalIgnoreCase))
-                .Take(12)
+                .Take(18)
                 .Select(command => new CommandSearchResult(command)
                 {
                     SearchTerm = query,
                     Match = Match(command.Description, query)
                 }));
 
-        // add matching files
-        newResults.AddRange(MaybeParseFilePaths(query));
+        try
+        {
+            // add matching files
+            newResults.AddRange(MaybeParseFilePaths(query));
+        }
+        catch
+        {
+            // ignored
+        }
 
         // add matching recent files
         newResults.AddRange(