Make using Find shortcut in its dialog select text

This commit is contained in:
OmrSi 2024-01-29 14:40:42 +02:00
parent 8ecdad90ad
commit 1640d7ffaf

View File

@ -13,6 +13,7 @@ namespace Nikse.SubtitleEdit.Forms
{
private readonly IFindAndReplace _findAndReplaceMethods;
private readonly Keys _findNextShortcut;
private readonly Keys _findShortcut;
private Regex _regEx;
private readonly Subtitle _subtitle;
@ -42,6 +43,7 @@ namespace Nikse.SubtitleEdit.Forms
UiUtil.FixLargeFonts(this, buttonFind);
_findNextShortcut = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainEditFindNext);
_findShortcut = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainEditFind);
}
private ReplaceType FindReplaceType
@ -122,6 +124,21 @@ namespace Nikse.SubtitleEdit.Forms
Focus();
ctrl?.Focus();
}
else if (e.KeyData == _findShortcut)
{
e.Handled = true;
e.SuppressKeyPress = true;
if (comboBoxFind.Visible)
{
comboBoxFind.Focus();
comboBoxFind.SelectAll();
}
else
{
textBoxFind.Focus();
textBoxFind.SelectAll();
}
}
}
private void ButtonFind_Click(object sender, EventArgs e)