mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Make find-next shortcut work in find/replace
This commit is contained in:
parent
93e59fce0d
commit
ddbfaa569f
@ -11,7 +11,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public sealed partial class FindDialog : PositionAndSizeForm
|
||||
{
|
||||
private readonly IFindAndReplace _findAndReplaceMethods;
|
||||
|
||||
private readonly Keys _findNextShortcut;
|
||||
private Regex _regEx;
|
||||
private readonly Subtitle _subtitle;
|
||||
|
||||
@ -40,6 +40,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
UiUtil.FixLargeFonts(this, buttonFind);
|
||||
_findNextShortcut = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainEditFindNext);
|
||||
}
|
||||
|
||||
private ReplaceType FindReplaceType
|
||||
@ -102,9 +103,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
e.Handled = true;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
else if (e.KeyData == _findNextShortcut)
|
||||
{
|
||||
e.Handled = true;
|
||||
e.SuppressKeyPress = true;
|
||||
var ctrl = ActiveControl;
|
||||
FindNext();
|
||||
Focus();
|
||||
ctrl?.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonFind_Click(object sender, EventArgs e)
|
||||
|
@ -11,7 +11,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public sealed partial class ReplaceDialog : PositionAndSizeForm
|
||||
{
|
||||
private readonly IFindAndReplace _findAndReplaceMethods;
|
||||
|
||||
private readonly Keys _findNextShortcut;
|
||||
private Regex _regEx;
|
||||
private bool _userAction;
|
||||
private bool _findNext;
|
||||
@ -42,6 +42,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
UiUtil.FixLargeFonts(this, buttonReplace);
|
||||
_findNextShortcut = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainEditFindNext);
|
||||
}
|
||||
|
||||
public bool ReplaceAll { get; set; }
|
||||
@ -79,6 +80,15 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
else if (e.KeyData == _findNextShortcut)
|
||||
{
|
||||
e.Handled = true;
|
||||
e.SuppressKeyPress = true;
|
||||
var ctrl = ActiveControl;
|
||||
Find();
|
||||
Focus();
|
||||
ctrl?.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper)
|
||||
|
Loading…
Reference in New Issue
Block a user