mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun][Calculator]Replace input with result with '=' key (#31391)
* replace input with result * fix and add test * add options and use result property
This commit is contained in:
committed by
GitHub
parent
e573b7a1b1
commit
92c85630a9
@@ -842,9 +842,6 @@ namespace PowerLauncher
|
||||
{
|
||||
if (_viewModel.Plugins.Count > 0 && _viewModel.SelectedPlugin != null)
|
||||
{
|
||||
// Needed to update UI in case the user choose the same plugin multiple times
|
||||
_viewModel.ChangeQueryText(string.Empty);
|
||||
|
||||
_viewModel.ChangeQueryText(_viewModel.SelectedPlugin.Metadata.ActionKeyword, true);
|
||||
SearchBox.QueryTextBox.Focus();
|
||||
|
||||
|
||||
@@ -49,7 +49,10 @@ namespace Wox
|
||||
|
||||
public void ChangeQuery(string query, bool requery = false)
|
||||
{
|
||||
_mainVM.ChangeQueryText(query, requery);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
_mainVM.ChangeQueryText(query, requery);
|
||||
});
|
||||
}
|
||||
|
||||
public void CheckForNewUpdate()
|
||||
|
||||
@@ -9,7 +9,6 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -380,8 +379,15 @@ namespace PowerLauncher.ViewModel
|
||||
/// <param name="requery">Optional Parameter that if true, will automatically execute a query against the updated text</param>
|
||||
public void ChangeQueryText(string queryText, bool requery = false)
|
||||
{
|
||||
var sameQueryText = SystemQueryText == queryText;
|
||||
|
||||
SystemQueryText = queryText;
|
||||
|
||||
if (sameQueryText)
|
||||
{
|
||||
OnPropertyChanged(nameof(SystemQueryText));
|
||||
}
|
||||
|
||||
if (requery)
|
||||
{
|
||||
QueryText = queryText;
|
||||
|
||||
Reference in New Issue
Block a user