mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Added default colors for step tool
This commit is contained in:
parent
ebdcc7273d
commit
8af49b0a51
3 changed files with 57 additions and 4 deletions
|
@ -43,10 +43,15 @@ public class AnnotationOptions
|
|||
|
||||
// Text drawing
|
||||
public TextDrawingOptions TextOptions { get; set; } = new TextDrawingOptions();
|
||||
public Color TextBorderColor { get; set; } = Color.Black;
|
||||
public int TextBorderSize { get; set; } = 1;
|
||||
public Color TextBorderColor { get; set; } = Color.White;
|
||||
public int TextBorderSize { get; set; } = 0;
|
||||
public Color TextFillColor { get; set; } = Color.FromArgb(150, Color.Black);
|
||||
|
||||
// Step drawing
|
||||
public Color StepBorderColor { get; set; } = Color.White;
|
||||
public int StepBorderSize { get; set; } = 0;
|
||||
public Color StepFillColor { get; set; } = Color.Red;
|
||||
|
||||
// Blur effect
|
||||
public int BlurRadius { get; set; } = 15;
|
||||
|
||||
|
|
|
@ -37,18 +37,32 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class StepDrawingShape : BaseDrawingShape
|
||||
{
|
||||
private const int DefaultSize = 30;
|
||||
|
||||
public override ShapeType ShapeType { get; } = ShapeType.DrawingStep;
|
||||
public override NodeType NodeType { get; } = NodeType.Point;
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
private const int DefaultSize = 30;
|
||||
|
||||
public StepDrawingShape()
|
||||
{
|
||||
Rectangle = new Rectangle(0, 0, DefaultSize, DefaultSize);
|
||||
}
|
||||
|
||||
public override void UpdateShapeConfig()
|
||||
{
|
||||
BorderColor = AnnotationOptions.StepBorderColor;
|
||||
BorderSize = AnnotationOptions.StepBorderSize;
|
||||
FillColor = AnnotationOptions.StepFillColor;
|
||||
}
|
||||
|
||||
public override void ApplyShapeConfig()
|
||||
{
|
||||
AnnotationOptions.StepBorderColor = BorderColor;
|
||||
AnnotationOptions.StepBorderSize = BorderSize;
|
||||
AnnotationOptions.StepFillColor = FillColor;
|
||||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
|
@ -63,6 +77,8 @@ public override void OnDraw(Graphics g)
|
|||
|
||||
if (BorderSize > 0 && BorderColor.A > 0)
|
||||
{
|
||||
//g.DrawEllipse(Pens.Black, Rectangle.LocationOffset(0, 1));
|
||||
|
||||
using (Pen pen = new Pen(BorderColor, BorderSize))
|
||||
{
|
||||
g.DrawEllipse(pen, Rectangle);
|
||||
|
|
|
@ -337,6 +337,10 @@ private void CreateContextMenu()
|
|||
{
|
||||
borderColor = AnnotationOptions.TextBorderColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
borderColor = AnnotationOptions.StepBorderColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
borderColor = AnnotationOptions.BorderColor;
|
||||
|
@ -350,6 +354,10 @@ private void CreateContextMenu()
|
|||
{
|
||||
AnnotationOptions.TextBorderColor = dialogColor.NewColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
AnnotationOptions.StepBorderColor = dialogColor.NewColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnnotationOptions.BorderColor = dialogColor.NewColor;
|
||||
|
@ -378,6 +386,10 @@ private void CreateContextMenu()
|
|||
{
|
||||
AnnotationOptions.TextBorderSize = borderSize;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
AnnotationOptions.StepBorderSize = borderSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnnotationOptions.BorderSize = borderSize;
|
||||
|
@ -400,6 +412,10 @@ private void CreateContextMenu()
|
|||
{
|
||||
fillColor = AnnotationOptions.TextFillColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
fillColor = AnnotationOptions.StepFillColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
fillColor = AnnotationOptions.FillColor;
|
||||
|
@ -413,6 +429,10 @@ private void CreateContextMenu()
|
|||
{
|
||||
AnnotationOptions.TextFillColor = dialogColor.NewColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
AnnotationOptions.StepFillColor = dialogColor.NewColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
AnnotationOptions.FillColor = dialogColor.NewColor;
|
||||
|
@ -610,6 +630,10 @@ private void UpdateContextMenu()
|
|||
{
|
||||
borderColor = AnnotationOptions.TextBorderColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
borderColor = AnnotationOptions.StepBorderColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
borderColor = AnnotationOptions.BorderColor;
|
||||
|
@ -624,6 +648,10 @@ private void UpdateContextMenu()
|
|||
{
|
||||
borderSize = AnnotationOptions.TextBorderSize;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
borderSize = AnnotationOptions.StepBorderSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
borderSize = AnnotationOptions.BorderSize;
|
||||
|
@ -637,6 +665,10 @@ private void UpdateContextMenu()
|
|||
{
|
||||
fillColor = AnnotationOptions.TextFillColor;
|
||||
}
|
||||
else if (shapeType == ShapeType.DrawingStep)
|
||||
{
|
||||
fillColor = AnnotationOptions.StepFillColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
fillColor = AnnotationOptions.FillColor;
|
||||
|
|
Loading…
Reference in a new issue