From 6747d12173c97000dcf0f99908ca7ab3c9717412 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 19 Nov 2024 08:29:50 +0100 Subject: [PATCH] Set focus on most relevant button in AutoTranslate + Remove-text-for-HI - thx Bob :) --- src/ui/Forms/RemoveTextForHearImpaired.cs | 1 + src/ui/Forms/Translate/AutoTranslate.Designer.cs | 1 + src/ui/Forms/Translate/AutoTranslate.cs | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/ui/Forms/RemoveTextForHearImpaired.cs b/src/ui/Forms/RemoveTextForHearImpaired.cs index 756a07e70..a05b5d41d 100644 --- a/src/ui/Forms/RemoveTextForHearImpaired.cs +++ b/src/ui/Forms/RemoveTextForHearImpaired.cs @@ -349,6 +349,7 @@ namespace Nikse.SubtitleEdit.Forms private void FormRemoveTextForHearImpaired_Shown(object sender, EventArgs e) { FormRemoveTextForHearImpaired_Resize(sender, e); + buttonOK.Focus(); } private void checkBoxRemoveTextBeforeColon_CheckedChanged(object sender, EventArgs e) diff --git a/src/ui/Forms/Translate/AutoTranslate.Designer.cs b/src/ui/Forms/Translate/AutoTranslate.Designer.cs index 7492c7643..14b55b606 100644 --- a/src/ui/Forms/Translate/AutoTranslate.Designer.cs +++ b/src/ui/Forms/Translate/AutoTranslate.Designer.cs @@ -520,6 +520,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "AutoTranslate"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AutoTranslate_FormClosing); + this.Shown += new System.EventHandler(this.AutoTranslate_Shown); this.ResizeEnd += new System.EventHandler(this.AutoTranslate_ResizeEnd); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AutoTranslate_KeyDown); this.Resize += new System.EventHandler(this.AutoTranslate_Resize); diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index b94435fc7..1e5e112ff 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1638,5 +1638,10 @@ namespace Nikse.SubtitleEdit.Forms.Translate { UiUtil.OpenUrl("https://ollama.com/library"); } + + private void AutoTranslate_Shown(object sender, EventArgs e) + { + buttonTranslate.Focus(); + } } }