[FindMyMouse]Do not activate on game mode (#13990)

* [FindMyMouse] Do not activate on game mode

* Add settings scaffolding

* fix spellchecker

* Address PR comments

* Adress UI feedback
This commit is contained in:
Jaime Bernardo
2021-10-25 19:39:48 +01:00
committed by GitHub
parent db90802e6e
commit af8366f0fe
14 changed files with 248 additions and 12 deletions

View File

@@ -1702,4 +1702,8 @@ From there, simply click on a Markdown file, PDF file or SVG icon in the File Ex
<value>Press the Left Control key twice to focus the mouse pointer.</value>
<comment>"Left Control" is a keyboard key.</comment>
</data>
<data name="MouseUtils_Prevent_Activation_On_Game_Mode.Content" xml:space="preserve">
<value>Do not activate when Game Mode is on</value>
<comment>"Game mode" is the Windows feature to prevent notification when playing a game.</comment>
</data>
</root>

View File

@@ -14,12 +14,21 @@
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical">
<controls:Setting x:Uid="MouseUtils_Enable_FindMyMouse" Icon="&#xF272;">
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind ViewModel.IsFindMyMouseEnabled, Mode=TwoWay}" HorizontalAlignment="Right"/>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:SettingExpander IsExpanded="True">
<controls:SettingExpander.Header>
<controls:Setting x:Uid="MouseUtils_Enable_FindMyMouse" Icon="&#xF272;">
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind ViewModel.IsFindMyMouseEnabled, Mode=TwoWay}" HorizontalAlignment="Right"/>
</controls:Setting.ActionContent>
</controls:Setting>
</controls:SettingExpander.Header>
<controls:SettingExpander.Content>
<CheckBox x:Uid="MouseUtils_Prevent_Activation_On_Game_Mode"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.FindMyMouseDoNotActivateOnGameMode}"
Margin="{StaticResource ExpanderSettingMargin}"
IsEnabled="{x:Bind ViewModel.IsFindMyMouseEnabled, Mode=OneWay}" />
</controls:SettingExpander.Content>
</controls:SettingExpander>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>

View File

@@ -15,7 +15,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
public MouseUtilsPage()
{
var settingsUtils = new SettingsUtils();
ViewModel = new MouseUtilsViewModel(SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
ViewModel = new MouseUtilsViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), SettingsRepository<FindMyMouseSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
DataContext = ViewModel;
InitializeComponent();
}