diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs index f4ef1b8e6c..43112a6eae 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs @@ -26,6 +26,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public bool ignore_hotkeys_in_fullscreen { get; set; } + public bool clear_input_on_launch { get; set; } + public PowerLauncherProperties() { open_powerlauncher = new HotkeySettings(); @@ -35,6 +37,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib search_result_preference = "most_recently_used"; search_type_preference = "application_name"; ignore_hotkeys_in_fullscreen = false; + clear_input_on_launch = false; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index 66ede11ad6..3da4ea8f8a 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -253,6 +253,9 @@ Ignore hotkeys in fullscreen mode + + Clear the previous query on launch + To: Keyboard Manager mapping keys view right header diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs index 268fa5ca0e..18cca99718 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs @@ -236,21 +236,38 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } } - public bool IgnoreHotkeysInFullScreen - { - get - { - return settings.properties.ignore_hotkeys_in_fullscreen; - } - - set - { - if (settings.properties.ignore_hotkeys_in_fullscreen != value) - { - settings.properties.ignore_hotkeys_in_fullscreen = value; - UpdateSettings(); - } - } + public bool IgnoreHotkeysInFullScreen + { + get + { + return settings.properties.ignore_hotkeys_in_fullscreen; + } + + set + { + if (settings.properties.ignore_hotkeys_in_fullscreen != value) + { + settings.properties.ignore_hotkeys_in_fullscreen = value; + UpdateSettings(); + } + } + } + + public bool ClearInputOnLaunch + { + get + { + return settings.properties.clear_input_on_launch; + } + + set + { + if (settings.properties.clear_input_on_launch != value) + { + settings.properties.clear_input_on_launch = value; + UpdateSettings(); + } + } } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml b/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml index 2f94f9fba2..fbc6c55ec9 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml @@ -134,6 +134,12 @@ IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}" /> + + + { + if(!string.IsNullOrEmpty(QueryText)) + { + ChangeQueryText(string.Empty,true); + //Push Event to UI SystemQuery has changed + OnPropertyChanged(nameof(SystemQueryText)); + } + }); } #endregion @@ -342,6 +352,8 @@ namespace Wox.ViewModel public ICommand LoadContextMenuCommand { get; set; } public ICommand LoadHistoryCommand { get; set; } public ICommand OpenResultCommand { get; set; } + public ICommand ClearQueryCommand { get; set; } + #endregion