Search by regex, modal Enter fixes

This commit is contained in:
2023-07-31 14:07:52 +02:00
parent a537277546
commit bc31b71130
38 changed files with 301 additions and 53 deletions

View File

@@ -30,11 +30,9 @@ public class FrequencyNavigationViewModel : FuzzyPanelViewModel<string>, IFreque
public void Close()
=> _frequencyNavigationService.CloseNavigationWindow();
public override async Task<bool> HandleKeyDown(KeyEventArgs keyEventArgs)
public async Task<bool> HandleKeyUp(KeyEventArgs keyEventArgs)
{
var handled = await base.HandleKeyDown(keyEventArgs);
if (handled) return true;
if (keyEventArgs.Handled) return false;
if (keyEventArgs.Key == Key.Enter)
{
@@ -49,6 +47,23 @@ public class FrequencyNavigationViewModel : FuzzyPanelViewModel<string>, IFreque
return false;
}
public override async Task<bool> HandleKeyDown(KeyEventArgs keyEventArgs)
{
if (keyEventArgs.Handled) return false;
var handled = await base.HandleKeyDown(keyEventArgs);
if (handled) return true;
if (keyEventArgs.Key == Key.Escape)
{
keyEventArgs.Handled = true;
Close();
return true;
}
return false;
}
public override void UpdateFilteredMatches() =>
FilteredMatches = new List<string>(_frequencyNavigationService.GetMatchingContainers(SearchText));