- Fixes cursor jumping around issue.

- Seperating the ability to set the text from initiating a query.
- Plugins have to explicitly request the query be updated.
- Updating Folder plugin to explicty update the query on folder selection.
- Removing unused changes from 'Wox' that don't compile.
This commit is contained in:
ryanbodrug-microsoft
2020-04-24 08:30:11 -07:00
parent 6290630787
commit 15b7b20500
5 changed files with 33 additions and 36 deletions

View File

@@ -350,21 +350,25 @@ namespace PowerLauncher
private void QueryTextBox_TextChanged(object sender, Windows.UI.Xaml.Controls.TextChangedEventArgs e)
{
var latestTimeOfTyping = DateTime.Now;
var text = ((Windows.UI.Xaml.Controls.TextBox)sender).Text;
Task.Run(() => DelayedCheck(latestTimeOfTyping, text));
s_lastTimeOfTyping = latestTimeOfTyping;
//To clear the auto-suggest immediately instead of waiting for selection changed
if(text == String.Empty)
if (text == String.Empty)
{
_launcher.AutoCompleteTextBox.PlaceholderText = String.Empty;
}
if (_viewModel.QueryTextCursorMovedToEnd)
if (_viewModel.QueryTextUpdateBySystem)
{
_launcher.TextBox.SelectionStart = _launcher.TextBox.Text.Length;
_viewModel.QueryTextCursorMovedToEnd = false;
_viewModel.QueryTextUpdateBySystem = false;
}
else
{
_viewModel.QueryText = text;
var latestTimeOfTyping = DateTime.Now;
Task.Run(() => DelayedCheck(latestTimeOfTyping, text));
s_lastTimeOfTyping = latestTimeOfTyping;
}
}
@@ -375,7 +379,7 @@ namespace PowerLauncher
{
await System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
_viewModel.QueryText = text;
_viewModel.Query();
}));
}
}