Minor combo box fix

This commit is contained in:
niksedk 2023-09-03 07:10:33 +02:00
parent df8e18e80e
commit 180889d586
2 changed files with 14 additions and 11 deletions

View File

@ -3369,4 +3369,4 @@ Keep changes?</KeepChangesMessage>
<CommandLineArguments>Extra parameters for Whisper command line:</CommandLineArguments> <CommandLineArguments>Extra parameters for Whisper command line:</CommandLineArguments>
<Info>Note: Different Whisper implementations have different command line parameters!</Info> <Info>Note: Different Whisper implementations have different command line parameters!</Info>
</WhisperAdvanced> </WhisperAdvanced>
</Language> </Language>

View File

@ -946,6 +946,15 @@ namespace Nikse.SubtitleEdit.Controls
var item = _listView.SelectedItems[0]; var item = _listView.SelectedItems[0];
_selectedIndex = item.Index; _selectedIndex = item.Index;
_textBox.Text = item.Text; _textBox.Text = item.Text;
HideDropDown();
args.SuppressKeyPress = true;
if (!_skipPaint)
{
Invalidate();
}
if (!_loading) if (!_loading)
{ {
SelectedIndexChanged?.Invoke(this, EventArgs.Empty); SelectedIndexChanged?.Invoke(this, EventArgs.Empty);
@ -953,13 +962,6 @@ namespace Nikse.SubtitleEdit.Controls
TextChanged?.Invoke(this, EventArgs.Empty); TextChanged?.Invoke(this, EventArgs.Empty);
} }
if (!_skipPaint)
{
Invalidate();
}
HideDropDown();
args.SuppressKeyPress = true;
} }
else else
{ {
@ -984,6 +986,10 @@ namespace Nikse.SubtitleEdit.Controls
_selectedIndex = i; _selectedIndex = i;
_textBox.Text = _listView.Items[i].Text; _textBox.Text = _listView.Items[i].Text;
HideDropDown();
_textBox.Focus();
_textBox.SelectionLength = 0;
if (!_loading) if (!_loading)
{ {
SelectedIndexChanged?.Invoke(this, EventArgs.Empty); SelectedIndexChanged?.Invoke(this, EventArgs.Empty);
@ -991,9 +997,6 @@ namespace Nikse.SubtitleEdit.Controls
TextChanged?.Invoke(this, EventArgs.Empty); TextChanged?.Invoke(this, EventArgs.Empty);
} }
HideDropDown();
_textBox.Focus();
_textBox.SelectionLength = 0;
return; return;
} }
} }