[Accessibility]Turn animations off based on Windows settings (#28128)

* FindMyMouse: switch animations on/off based on global windows settings

* Fancy Zones: enable/disable animations based on global Windows settings

* Shortcut Guide: enabling/disabling animations based on global Windows settings

* spell checker

* Making MouseUtils settings dependent on global windows settings, AnimationEffects. If the global settings is disabled the MouseUtils animation settings is disabled too, description shows the reason.

* Adding error detection, log on SystemParametersInfo call.

* Adding infobar instead of changing description of the settingsbar.

* spell checker

* moving native constant into NativeMethods class
This commit is contained in:
Laszlo Nemeth
2023-09-05 15:25:24 +02:00
committed by GitHub
parent 298a5eba2a
commit 83bb573223
10 changed files with 68 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ using global::PowerToys.GPOWrapper;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
using Microsoft.PowerToys.Settings.Utilities;
namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
@@ -114,6 +115,10 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_mousePointerCrosshairsFixedLength = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsFixedLength.Value;
_mousePointerCrosshairsAutoActivate = MousePointerCrosshairsSettingsConfig.Properties.AutoActivate.Value;
int isEnabled = 0;
NativeMethods.SystemParametersInfo(NativeMethods.SPI_GETCLIENTAREAANIMATION, 0, ref isEnabled, 0);
_isAnimationEnabledBySystem = isEnabled != 0;
// set the callback functions value to handle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
}
@@ -327,6 +332,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool IsAnimationEnabledBySystem
{
get
{
return _isAnimationEnabledBySystem;
}
set
{
_isAnimationEnabledBySystem = value;
}
}
public int FindMyMouseAnimationDurationMs
{
get
@@ -970,5 +988,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private bool _mousePointerCrosshairsIsFixedLengthEnabled;
private int _mousePointerCrosshairsFixedLength;
private bool _mousePointerCrosshairsAutoActivate;
private bool _isAnimationEnabledBySystem;
}
}