From a396e61fdadcf7559878616302879182432a2c95 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 12 Oct 2024 14:54:28 +0200 Subject: [PATCH] Try to fix color picker issue - thx Siamak :) --- src/ui/Forms/ColorChooser.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/Forms/ColorChooser.cs b/src/ui/Forms/ColorChooser.cs index d16003883..4282f4766 100644 --- a/src/ui/Forms/ColorChooser.cs +++ b/src/ui/Forms/ColorChooser.cs @@ -196,6 +196,7 @@ namespace Nikse.SubtitleEdit.Forms return; } + ActiveControl = null; _changeType = ChangeStyle.MouseMove; _selectedPoint = new Point(e.X, e.Y); Invalidate(); @@ -497,6 +498,7 @@ namespace Nikse.SubtitleEdit.Forms this._pnlBrightness.Size = new System.Drawing.Size(24, 216); this._pnlBrightness.TabIndex = 39; this._pnlBrightness.Visible = false; + this._pnlBrightness.MouseClick += new System.Windows.Forms.MouseEventHandler(this._pnlBrightness_MouseClick); // // _lblAlpha2 // @@ -1035,6 +1037,7 @@ namespace Nikse.SubtitleEdit.Forms private void PanelColorClick(Control panel) { + panel.Focus(); var c = panel.BackColor; UpdateRgb($"{c.R:x2}{c.G:x2}{c.B:x2}{c.A:x2}"); _tbHexCode.TextChanged -= TextBoxHexCodeTextChanged; @@ -1056,25 +1059,21 @@ namespace Nikse.SubtitleEdit.Forms private void panelC2_MouseClick(object sender, MouseEventArgs e) { PanelColorClick(_panelC2); - } private void panelC3_MouseClick(object sender, MouseEventArgs e) { PanelColorClick(_panelC3); - } private void panelC4_MouseClick(object sender, MouseEventArgs e) { PanelColorClick(_panelC4); - } private void panelC5_MouseClick(object sender, MouseEventArgs e) { PanelColorClick(_panelC5); - } private void panelC6_MouseClick(object sender, MouseEventArgs e) @@ -1104,5 +1103,10 @@ namespace Nikse.SubtitleEdit.Forms { _tbHexCode.MaxLength = _showAlpha ? 9 : 7; } + + private void _pnlBrightness_MouseClick(object sender, MouseEventArgs e) + { + + } } }