mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
BUG-2102: Fixing an issue when a second ColorDialog is opened.
This commit is contained in:
parent
9e95482881
commit
98415aaa81
3 changed files with 9 additions and 11 deletions
|
@ -68,8 +68,10 @@ namespace Greenshot.Controls {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ColorButtonClick(object sender, EventArgs e) {
|
private void ColorButtonClick(object sender, EventArgs e) {
|
||||||
ColorDialog colorDialog = ColorDialog.GetInstance();
|
var colorDialog = new ColorDialog
|
||||||
colorDialog.Color = SelectedColor;
|
{
|
||||||
|
Color = SelectedColor
|
||||||
|
};
|
||||||
// Using the parent to make sure the dialog doesn't show on another window
|
// Using the parent to make sure the dialog doesn't show on another window
|
||||||
colorDialog.ShowDialog(Parent.Parent);
|
colorDialog.ShowDialog(Parent.Parent);
|
||||||
if (colorDialog.DialogResult == DialogResult.Cancel)
|
if (colorDialog.DialogResult == DialogResult.Cancel)
|
||||||
|
|
|
@ -66,8 +66,10 @@ namespace Greenshot.Controls {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ColorButtonClick(object sender, EventArgs e) {
|
private void ColorButtonClick(object sender, EventArgs e) {
|
||||||
ColorDialog colorDialog = ColorDialog.GetInstance();
|
var colorDialog = new ColorDialog
|
||||||
colorDialog.Color = SelectedColor;
|
{
|
||||||
|
Color = SelectedColor
|
||||||
|
};
|
||||||
// Using the parent to make sure the dialog doesn't show on another window
|
// Using the parent to make sure the dialog doesn't show on another window
|
||||||
colorDialog.ShowDialog(Parent.Parent);
|
colorDialog.ShowDialog(Parent.Parent);
|
||||||
if (colorDialog.DialogResult == DialogResult.Cancel)
|
if (colorDialog.DialogResult == DialogResult.Cancel)
|
||||||
|
|
|
@ -34,10 +34,9 @@ namespace Greenshot {
|
||||||
/// Description of ColorDialog.
|
/// Description of ColorDialog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ColorDialog : BaseForm {
|
public partial class ColorDialog : BaseForm {
|
||||||
private static ColorDialog _uniqueInstance;
|
|
||||||
private static readonly EditorConfiguration EditorConfig = IniConfig.GetIniSection<EditorConfiguration>();
|
private static readonly EditorConfiguration EditorConfig = IniConfig.GetIniSection<EditorConfiguration>();
|
||||||
|
|
||||||
private ColorDialog() {
|
public ColorDialog() {
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
|
@ -47,11 +46,6 @@ namespace Greenshot {
|
||||||
UpdateRecentColorsButtonRow();
|
UpdateRecentColorsButtonRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorDialog GetInstance()
|
|
||||||
{
|
|
||||||
return _uniqueInstance ?? (_uniqueInstance = new ColorDialog());
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly List<Button> _colorButtons = new List<Button>();
|
private readonly List<Button> _colorButtons = new List<Button>();
|
||||||
private readonly List<Button> _recentColorButtons = new List<Button>();
|
private readonly List<Button> _recentColorButtons = new List<Button>();
|
||||||
private readonly ToolTip _toolTip = new ToolTip();
|
private readonly ToolTip _toolTip = new ToolTip();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue