mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
fix: Ctrl+F
is not working when Welcome page is not focused (#398)
This commit is contained in:
parent
c76d521f12
commit
e845c270cd
2 changed files with 14 additions and 7 deletions
|
@ -3,6 +3,7 @@ using System;
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
|
@ -160,6 +161,19 @@ namespace SourceGit.Views
|
|||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var welcome = this.FindDescendantOfType<Welcome>();
|
||||
if (welcome != null)
|
||||
{
|
||||
if (e.Key == Key.F)
|
||||
{
|
||||
welcome.SearchBox.Focus();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Key == Key.Escape)
|
||||
{
|
||||
|
|
|
@ -45,13 +45,6 @@ namespace SourceGit.Views
|
|||
TreeContainer.Focus(NavigationMethod.Directional);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.F &&
|
||||
((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) ||
|
||||
(!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control))))
|
||||
{
|
||||
SearchBox.Focus();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.Escape)
|
||||
{
|
||||
ViewModels.Welcome.Instance.ClearSearchFilter();
|
||||
|
|
Loading…
Reference in a new issue