mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-05 04:39:08 +08:00
Updating the QueryText to the selected item when navigating up/down with the arrow keys.
This commit is contained in:
parent
aa79325d76
commit
9d3720557e
@ -239,21 +239,25 @@ namespace PowerLauncher
|
||||
if (e.Key == VirtualKey.Tab && IsKeyDown(VirtualKey.Shift))
|
||||
{
|
||||
_viewModel.SelectPrevTabItemCommand.Execute(null);
|
||||
UpdateTextBoxToSelectedItem();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == VirtualKey.Tab)
|
||||
{
|
||||
_viewModel.SelectNextTabItemCommand.Execute(null);
|
||||
_viewModel.SelectNextTabItemCommand.Execute(null);
|
||||
UpdateTextBoxToSelectedItem();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == VirtualKey.Down)
|
||||
{
|
||||
_viewModel.SelectNextItemCommand.Execute(null);
|
||||
UpdateTextBoxToSelectedItem();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == VirtualKey.Up)
|
||||
{
|
||||
_viewModel.SelectPrevItemCommand.Execute(null);
|
||||
UpdateTextBoxToSelectedItem();
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == VirtualKey.PageDown)
|
||||
@ -268,6 +272,15 @@ namespace PowerLauncher
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTextBoxToSelectedItem()
|
||||
{
|
||||
var itemText = _viewModel?.Results?.SelectedItem?.ToString() ?? null;
|
||||
if (!String.IsNullOrEmpty(itemText))
|
||||
{
|
||||
_viewModel.ChangeQueryText(itemText);
|
||||
}
|
||||
}
|
||||
|
||||
private void SuggestionsList_Tapped(object sender, TappedRoutedEventArgs e)
|
||||
{
|
||||
var result = ((Windows.UI.Xaml.FrameworkElement)e.OriginalSource).DataContext;
|
||||
|
Loading…
Reference in New Issue
Block a user