mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Added drop shadow option to region capture toolbar
This commit is contained in:
parent
9000cf31a7
commit
35335e0d43
5 changed files with 24 additions and 5 deletions
|
@ -31,8 +31,9 @@ public class AnnotationOptions
|
|||
{
|
||||
// Drawing
|
||||
public Color BorderColor { get; set; } = Color.Red;
|
||||
public int BorderSize { get; set; } = 3;
|
||||
public int BorderSize { get; set; } = 5;
|
||||
public Color FillColor { get; set; } = Color.FromArgb(0, 0, 0, 0);
|
||||
public bool Shadow { get; set; } = true;
|
||||
|
||||
// Rounded rectangle region, rounded rectangle drawing
|
||||
public int RoundedRectangleRadius { get; set; } = 8;
|
||||
|
|
|
@ -48,6 +48,7 @@ public override void OnConfigLoad()
|
|||
BorderColor = AnnotationOptions.BorderColor;
|
||||
BorderSize = AnnotationOptions.BorderSize;
|
||||
FillColor = AnnotationOptions.FillColor;
|
||||
Shadow = AnnotationOptions.Shadow;
|
||||
}
|
||||
|
||||
public override void OnConfigSave()
|
||||
|
@ -55,6 +56,7 @@ public override void OnConfigSave()
|
|||
AnnotationOptions.BorderColor = BorderColor;
|
||||
AnnotationOptions.BorderSize = BorderSize;
|
||||
AnnotationOptions.FillColor = FillColor;
|
||||
AnnotationOptions.Shadow = Shadow;
|
||||
}
|
||||
|
||||
public abstract void OnDraw(Graphics g);
|
||||
|
|
|
@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Text;
|
||||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
|
@ -60,6 +59,7 @@ public override void OnConfigLoad()
|
|||
BorderColor = AnnotationOptions.StepBorderColor;
|
||||
BorderSize = AnnotationOptions.StepBorderSize;
|
||||
FillColor = AnnotationOptions.StepFillColor;
|
||||
Shadow = AnnotationOptions.Shadow;
|
||||
}
|
||||
|
||||
public override void OnConfigSave()
|
||||
|
@ -67,6 +67,7 @@ public override void OnConfigSave()
|
|||
AnnotationOptions.StepBorderColor = BorderColor;
|
||||
AnnotationOptions.StepBorderSize = BorderSize;
|
||||
AnnotationOptions.StepFillColor = FillColor;
|
||||
AnnotationOptions.Shadow = Shadow;
|
||||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
|
|
|
@ -43,6 +43,7 @@ public override void OnConfigLoad()
|
|||
BorderSize = AnnotationOptions.TextBorderSize;
|
||||
FillColor = AnnotationOptions.TextFillColor;
|
||||
CornerRadius = AnnotationOptions.TextCornerRadius;
|
||||
Shadow = AnnotationOptions.Shadow;
|
||||
}
|
||||
|
||||
public override void OnConfigSave()
|
||||
|
@ -51,7 +52,8 @@ public override void OnConfigSave()
|
|||
AnnotationOptions.TextBorderColor = BorderColor;
|
||||
AnnotationOptions.TextBorderSize = BorderSize;
|
||||
AnnotationOptions.TextFillColor = FillColor;
|
||||
AnnotationOptions.TextCornerRadius = (int)CornerRadius;
|
||||
AnnotationOptions.TextCornerRadius = CornerRadius;
|
||||
AnnotationOptions.Shadow = Shadow;
|
||||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
|
|
|
@ -42,7 +42,7 @@ internal partial class ShapeManager
|
|||
private ToolStripEx tsMain;
|
||||
private ToolStripButton tsbBorderColor, tsbFillColor, tsbHighlightColor, tsbUndoObject, tsbDeleteAll;
|
||||
private ToolStripDropDownButton tsddbShapeOptions;
|
||||
private ToolStripMenuItem tsmiQuickCrop, tsmiRegionCapture;
|
||||
private ToolStripMenuItem tsmiShadow, tsmiQuickCrop, tsmiRegionCapture;
|
||||
private ToolStripLabeledNumericUpDown tslnudBorderSize, tslnudCornerRadius, tslnudBlurRadius, tslnudPixelateSize;
|
||||
private ToolStripLabel tslDragLeft;
|
||||
|
||||
|
@ -373,7 +373,6 @@ private void CreateToolbar()
|
|||
|
||||
tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
|
||||
tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
||||
tsddbShapeOptions.HideImageMargin();
|
||||
tsddbShapeOptions.Image = Resources.layer__pencil;
|
||||
tsMain.Items.Add(tsddbShapeOptions);
|
||||
|
||||
|
@ -444,6 +443,16 @@ private void CreateToolbar()
|
|||
};
|
||||
tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);
|
||||
|
||||
tsmiShadow = new ToolStripMenuItem("Drop shadow");
|
||||
tsmiShadow.Checked = true;
|
||||
tsmiShadow.CheckOnClick = true;
|
||||
tsmiShadow.Click += (sender, e) =>
|
||||
{
|
||||
AnnotationOptions.Shadow = tsmiShadow.Checked;
|
||||
UpdateCurrentShape();
|
||||
};
|
||||
tsddbShapeOptions.DropDownItems.Add(tsmiShadow);
|
||||
|
||||
// In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
|
||||
tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator() { Visible = false });
|
||||
|
||||
|
@ -902,6 +911,8 @@ private void UpdateMenu()
|
|||
if (tsbHighlightColor.Image != null) tsbHighlightColor.Image.Dispose();
|
||||
tsbHighlightColor.Image = ImageHelpers.CreateColorPickerIcon(AnnotationOptions.HighlightColor, new Rectangle(0, 0, 16, 16));
|
||||
|
||||
tsmiShadow.Checked = AnnotationOptions.Shadow;
|
||||
|
||||
switch (shapeType)
|
||||
{
|
||||
default:
|
||||
|
@ -930,6 +941,7 @@ private void UpdateMenu()
|
|||
default:
|
||||
tsbBorderColor.Visible = false;
|
||||
tslnudBorderSize.Visible = false;
|
||||
tsmiShadow.Visible = false;
|
||||
break;
|
||||
case ShapeType.DrawingRectangle:
|
||||
case ShapeType.DrawingRoundedRectangle:
|
||||
|
@ -942,6 +954,7 @@ private void UpdateMenu()
|
|||
case ShapeType.DrawingStep:
|
||||
tsbBorderColor.Visible = true;
|
||||
tslnudBorderSize.Visible = true;
|
||||
tsmiShadow.Visible = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue