diff --git a/Greenshot/Controls/ColorButton.cs b/Greenshot/Controls/ColorButton.cs index d37fbf1c9..a08f0afab 100644 --- a/Greenshot/Controls/ColorButton.cs +++ b/Greenshot/Controls/ColorButton.cs @@ -68,8 +68,10 @@ namespace Greenshot.Controls { } private void ColorButtonClick(object sender, EventArgs e) { - ColorDialog colorDialog = ColorDialog.GetInstance(); - colorDialog.Color = SelectedColor; + var colorDialog = new ColorDialog + { + Color = SelectedColor + }; // Using the parent to make sure the dialog doesn't show on another window colorDialog.ShowDialog(Parent.Parent); if (colorDialog.DialogResult == DialogResult.Cancel) diff --git a/Greenshot/Controls/ToolStripColorButton.cs b/Greenshot/Controls/ToolStripColorButton.cs index ac4fcd736..8f5acd7d9 100644 --- a/Greenshot/Controls/ToolStripColorButton.cs +++ b/Greenshot/Controls/ToolStripColorButton.cs @@ -66,8 +66,10 @@ namespace Greenshot.Controls { } private void ColorButtonClick(object sender, EventArgs e) { - ColorDialog colorDialog = ColorDialog.GetInstance(); - colorDialog.Color = SelectedColor; + var colorDialog = new ColorDialog + { + Color = SelectedColor + }; // Using the parent to make sure the dialog doesn't show on another window colorDialog.ShowDialog(Parent.Parent); if (colorDialog.DialogResult == DialogResult.Cancel) diff --git a/Greenshot/Forms/ColorDialog.cs b/Greenshot/Forms/ColorDialog.cs index 5cfbf187d..5799e0351 100644 --- a/Greenshot/Forms/ColorDialog.cs +++ b/Greenshot/Forms/ColorDialog.cs @@ -34,10 +34,9 @@ namespace Greenshot { /// Description of ColorDialog. /// public partial class ColorDialog : BaseForm { - private static ColorDialog _uniqueInstance; private static readonly EditorConfiguration EditorConfig = IniConfig.GetIniSection(); - private ColorDialog() { + public ColorDialog() { SuspendLayout(); InitializeComponent(); SuspendLayout(); @@ -47,11 +46,6 @@ namespace Greenshot { UpdateRecentColorsButtonRow(); } - public static ColorDialog GetInstance() - { - return _uniqueInstance ?? (_uniqueInstance = new ColorDialog()); - } - private readonly List