mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Lots of small tweaks (#5960)
This commit is contained in:
@@ -73,13 +73,13 @@ namespace PowerLauncher
|
||||
Activate();
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs _)
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowsInteropHelper.DisableControlBox(this);
|
||||
InitializePosition();
|
||||
|
||||
SearchBox.QueryTextBox.DataContext = _viewModel;
|
||||
SearchBox.QueryTextBox.PreviewKeyDown += _launcher_KeyDown;
|
||||
SearchBox.QueryTextBox.PreviewKeyDown += Launcher_KeyDown;
|
||||
SearchBox.QueryTextBox.TextChanged += QueryTextBox_TextChanged;
|
||||
|
||||
// Set initial language flow direction
|
||||
@@ -103,10 +103,8 @@ namespace PowerLauncher
|
||||
var result = ((FrameworkElement)e.OriginalSource).DataContext;
|
||||
if (result != null)
|
||||
{
|
||||
var resultVM = result as ResultViewModel;
|
||||
|
||||
// This may be null if the tapped item was one of the context buttons (run as admin etc).
|
||||
if (resultVM != null)
|
||||
if (result is ResultViewModel resultVM)
|
||||
{
|
||||
_viewModel.Results.SelectedItem = resultVM;
|
||||
_viewModel.OpenResultCommand.Execute(null);
|
||||
@@ -222,7 +220,7 @@ namespace PowerLauncher
|
||||
return top;
|
||||
}
|
||||
|
||||
private void _launcher_KeyDown(object sender, KeyEventArgs e)
|
||||
private void Launcher_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Tab && Keyboard.IsKeyDown(Key.LeftShift))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user