mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[PowerToys Run] Implemented Setting to Clear Search Query when PowerToys Run is Launched (#4995)
* Implemented Clear Input On Launch * Move logic to seperate command on viewmodel * Added Settings Sync Moved logic from OnDeactivated to OnActivated * Complete after testing Co-authored-by: Roy <royvou@hotmailcom>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +253,9 @@
|
||||
<data name="PowerLauncher_IgnoreHotkeysInFullScreen.Content" xml:space="preserve">
|
||||
<value>Ignore hotkeys in fullscreen mode</value>
|
||||
</data>
|
||||
<data name="PowerLauncher_ClearInputOnLaunch.Content" xml:space="preserve">
|
||||
<value>Clear the previous query on launch</value>
|
||||
</data>
|
||||
<data name="KeyboardManager_KeysMappingLayoutRightHeader.Text" xml:space="preserve">
|
||||
<value>To:</value>
|
||||
<comment>Keyboard Manager mapping keys view right header</comment>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,12 @@
|
||||
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
|
||||
/>
|
||||
|
||||
<CheckBox x:Uid="PowerLauncher_ClearInputOnLaunch"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ClearInputOnLaunch}"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
|
||||
/>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
x:Name="SidePanel"
|
||||
|
||||
@@ -131,5 +131,7 @@ namespace ViewModelTests
|
||||
Assert.IsTrue(mockSettings.properties.override_win_r_key);
|
||||
Assert.IsFalse(mockSettings.properties.override_win_s_key);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user