Show editor background color on menu icon

This commit is contained in:
Jaex 2017-11-08 21:24:25 +03:00
parent a7e122b922
commit 2b5c9c7b11

View file

@ -49,7 +49,8 @@ internal partial class ShapeManager
private ToolStripEx tsMain;
private ToolStripButton tsbBorderColor, tsbFillColor, tsbHighlightColor;
private ToolStripDropDownButton tsddbShapeOptions;
private ToolStripMenuItem tsmiArrowHeadsBothSide, tsmiShadow, tsmiUndo, tsmiDelete, tsmiDeleteAll, tsmiMoveTop, tsmiMoveUp, tsmiMoveDown, tsmiMoveBottom, tsmiRegionCapture, tsmiQuickCrop, tsmiTips;
private ToolStripMenuItem tsmiArrowHeadsBothSide, tsmiShadow, tsmiUndo, tsmiDelete, tsmiDeleteAll, tsmiMoveTop, tsmiMoveUp, tsmiMoveDown, tsmiMoveBottom,
tsmiRegionCapture, tsmiQuickCrop, tsmiTips, tsmiEditorBackgroundColor;
private ToolStripLabeledNumericUpDown tslnudBorderSize, tslnudCornerRadius, tslnudCenterPoints, tslnudBlurRadius, tslnudPixelateSize;
private ToolStripLabel tslDragLeft, tslDragRight;
private ToolStripLabeledComboBox tscbCursorTypes;
@ -741,7 +742,7 @@ internal void CreateToolbar()
tsmiEditorModeFullscreen.Click += (sender, e) => Options.EditorModeFullscreen = tsmiEditorModeFullscreen.Checked;
tsddbOptions.DropDownItems.Add(tsmiEditorModeFullscreen);
ToolStripMenuItem tsmiEditorBackgroundColor = new ToolStripMenuItem("Editor background color...");
tsmiEditorBackgroundColor = new ToolStripMenuItem("Editor background color...");
tsmiEditorBackgroundColor.Click += (sender, e) =>
{
PauseForm();
@ -749,6 +750,7 @@ internal void CreateToolbar()
if (ColorPickerForm.PickColor(Options.EditorBackgroundColor, out Color newColor))
{
Options.EditorBackgroundColor = newColor;
UpdateMenu();
}
ResumeForm();
@ -1276,6 +1278,12 @@ private void UpdateMenu()
{
tsmiRegionCapture.Visible = !Options.QuickCrop && ValidRegions.Length > 0;
}
if (tsmiEditorBackgroundColor != null)
{
if (tsmiEditorBackgroundColor.Image != null) tsmiEditorBackgroundColor.Image.Dispose();
tsmiEditorBackgroundColor.Image = ImageHelpers.CreateColorPickerIcon(Options.EditorBackgroundColor, new Rectangle(0, 0, 16, 16));
}
}
internal Cursor GetSelectedCursor()