[MeasureTool]Add setting to specify the default measure style (#25645)

* MeasureTool: Add possibility to specify the default measure style

* MeasureTool: Improve description of user setting

* MeasureTool: Use enum value instead of magic number
This commit is contained in:
Sebastian Zanoni
2023-04-27 16:38:24 +02:00
committed by GitHub
parent 4af9f0172d
commit 78d705890a
9 changed files with 130 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Settings.UI.Library.Enumerations
{
public enum MeasureToolMeasureStyle
{
None,
Bounds,
Spacing,
HorizontalSpacing,
VerticalSpacing,
}
}

View File

@@ -4,6 +4,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.Library
{
@@ -18,6 +19,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
DrawFeetOnCross = true;
PerColorChannelEdgeDetection = false;
MeasureCrossColor = new StringProperty("#FF4500");
DefaultMeasureStyle = new IntProperty((int)MeasureToolMeasureStyle.None);
}
public HotkeySettings ActivationShortcut { get; set; }
@@ -37,6 +39,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public StringProperty MeasureCrossColor { get; set; }
public IntProperty DefaultMeasureStyle { get; set; }
public override string ToString() => JsonSerializer.Serialize(this);
}
}