2022-08-27 07:17:20 +08:00
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
using System.Text.Json.Serialization;
|
2023-04-27 22:38:24 +08:00
|
|
|
|
using Settings.UI.Library.Enumerations;
|
2022-08-27 07:17:20 +08:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
|
|
|
|
{
|
|
|
|
|
public class MeasureToolProperties
|
|
|
|
|
{
|
2023-06-20 21:42:04 +08:00
|
|
|
|
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x4D);
|
|
|
|
|
|
2022-08-27 07:17:20 +08:00
|
|
|
|
public MeasureToolProperties()
|
|
|
|
|
{
|
2023-06-20 21:42:04 +08:00
|
|
|
|
ActivationShortcut = DefaultActivationShortcut;
|
2022-09-05 20:39:56 +08:00
|
|
|
|
UnitsOfMeasure = new IntProperty(0);
|
2022-08-27 07:17:20 +08:00
|
|
|
|
PixelTolerance = new IntProperty(30);
|
2022-09-10 02:25:05 +08:00
|
|
|
|
ContinuousCapture = false;
|
2022-08-27 07:17:20 +08:00
|
|
|
|
DrawFeetOnCross = true;
|
|
|
|
|
PerColorChannelEdgeDetection = false;
|
|
|
|
|
MeasureCrossColor = new StringProperty("#FF4500");
|
2023-04-27 22:38:24 +08:00
|
|
|
|
DefaultMeasureStyle = new IntProperty((int)MeasureToolMeasureStyle.None);
|
2022-08-27 07:17:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HotkeySettings ActivationShortcut { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
public bool ContinuousCapture { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
public bool DrawFeetOnCross { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
public bool PerColorChannelEdgeDetection { get; set; }
|
|
|
|
|
|
2022-09-05 20:39:56 +08:00
|
|
|
|
public IntProperty UnitsOfMeasure { get; set; }
|
|
|
|
|
|
2022-08-27 07:17:20 +08:00
|
|
|
|
public IntProperty PixelTolerance { get; set; }
|
|
|
|
|
|
|
|
|
|
public StringProperty MeasureCrossColor { get; set; }
|
|
|
|
|
|
2023-04-27 22:38:24 +08:00
|
|
|
|
public IntProperty DefaultMeasureStyle { get; set; }
|
|
|
|
|
|
2022-08-27 07:17:20 +08:00
|
|
|
|
public override string ToString() => JsonSerializer.Serialize(this);
|
|
|
|
|
}
|
|
|
|
|
}
|