[MousePointerCrosshairs]Added a fixed length option (#27471)

* #19638 Added the option to Mouse Crosshairs to fix the lengths of the crosshairs. Some discussion about design in the issue but currently implemented as a configuration toggle and separate length input.

* Fixed crosshairs fixed lengthed enabled not being read on view model initialization
This commit is contained in:
Epp-code
2023-07-19 07:24:47 -07:00
committed by GitHub
parent e44d63451f
commit 1f44085e41
7 changed files with 149 additions and 17 deletions

View File

@@ -107,6 +107,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_mousePointerCrosshairsThickness = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsThickness.Value;
_mousePointerCrosshairsBorderSize = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsBorderSize.Value;
_mousePointerCrosshairsAutoHide = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsAutoHide.Value;
_mousePointerCrosshairsIsFixedLengthEnabled = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsIsFixedLengthEnabled.Value;
_mousePointerCrosshairsFixedLength = MousePointerCrosshairsSettingsConfig.Properties.CrosshairsFixedLength.Value;
// set the callback functions value to handle outgoing IPC message.
SendConfigMSG = ipcMSGCallBackFunc;
@@ -811,6 +813,42 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool MousePointerCrosshairsIsFixedLengthEnabled
{
get
{
return _mousePointerCrosshairsIsFixedLengthEnabled;
}
set
{
if (value != _mousePointerCrosshairsIsFixedLengthEnabled)
{
_mousePointerCrosshairsIsFixedLengthEnabled = value;
MousePointerCrosshairsSettingsConfig.Properties.CrosshairsIsFixedLengthEnabled.Value = value;
NotifyMousePointerCrosshairsPropertyChanged();
}
}
}
public int MousePointerCrosshairsFixedLength
{
get
{
return _mousePointerCrosshairsFixedLength;
}
set
{
if (value != _mousePointerCrosshairsFixedLength)
{
_mousePointerCrosshairsFixedLength = value;
MousePointerCrosshairsSettingsConfig.Properties.CrosshairsFixedLength.Value = value;
NotifyMousePointerCrosshairsPropertyChanged();
}
}
}
public void NotifyMousePointerCrosshairsPropertyChanged([CallerMemberName] string propertyName = null)
{
OnPropertyChanged(propertyName);
@@ -870,5 +908,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private string _mousePointerCrosshairsBorderColor;
private int _mousePointerCrosshairsBorderSize;
private bool _mousePointerCrosshairsAutoHide;
private bool _mousePointerCrosshairsIsFixedLengthEnabled;
private int _mousePointerCrosshairsFixedLength;
}
}