From a684c9e23d3f9c56faa8d35b70280303d38cc4b7 Mon Sep 17 00:00:00 2001 From: OmrSi Date: Fri, 22 Jan 2021 18:56:24 +0200 Subject: [PATCH 1/3] Set last column width for listviews --- src/ui/Forms/AddWaveformBatch.Designer.cs | 2 ++ src/ui/Forms/AddWaveformBatch.cs | 10 +++++++ src/ui/Forms/ApplyDurationLimits.Designer.cs | 3 ++- src/ui/Forms/ApplyDurationLimits.cs | 6 +++++ .../Forms/AutoBreakUnbreakLines.Designer.cs | 2 ++ src/ui/Forms/AutoBreakUnbreakLines.cs | 10 +++++++ src/ui/Forms/BatchConvert.cs | 2 +- src/ui/Forms/BookmarksGoTo.Designer.cs | 2 ++ src/ui/Forms/BookmarksGoTo.cs | 10 +++++++ src/ui/Forms/ChangeCasingNames.Designer.cs | 3 ++- src/ui/Forms/ChangeCasingNames.cs | 7 +++++ src/ui/Forms/ChooseEncoding.Designer.cs | 4 ++- src/ui/Forms/ChooseEncoding.cs | 26 +++++++++++++------ src/ui/Forms/ChooseStyle.Designer.cs | 2 ++ src/ui/Forms/ChooseStyle.cs | 9 +++++++ src/ui/Forms/ExportCustomText.Designer.cs | 2 ++ src/ui/Forms/ExportCustomText.cs | 10 +++++++ src/ui/Forms/ExportPngXml.Designer.cs | 6 ++--- src/ui/Forms/ExportPngXml.cs | 2 +- src/ui/Forms/FixCommonErrors.cs | 4 ++- src/ui/Forms/ImportImages.Designer.cs | 2 ++ src/ui/Forms/ImportImages.cs | 10 +++++++ src/ui/Forms/ImportText.Designer.cs | 3 ++- src/ui/Forms/ImportText.cs | 7 +++++ src/ui/Forms/JoinSubtitles.Designer.cs | 2 +- src/ui/Forms/JoinSubtitles.cs | 2 +- .../Forms/MatroskaSubtitleChooser.Designer.cs | 2 ++ src/ui/Forms/MatroskaSubtitleChooser.cs | 10 +++++++ src/ui/Forms/MergeDoubleLines.Designer.cs | 4 +-- src/ui/Forms/MergeDoubleLines.cs | 3 ++- src/ui/Forms/MergeShortLines.Designer.cs | 3 ++- src/ui/Forms/MergeShortLines.cs | 7 +++++ .../MergeTextWithSameTimeCodes.Designer.cs | 4 +-- src/ui/Forms/MergeTextWithSameTimeCodes.cs | 3 ++- src/ui/Forms/ModifySelection.Designer.cs | 1 + src/ui/Forms/ModifySelection.cs | 7 ++++- src/ui/Forms/NetflixFixErrors.cs | 2 +- .../Forms/Networking/NetworkChat.Designer.cs | 2 ++ src/ui/Forms/Networking/NetworkChat.cs | 13 +++++++++- src/ui/Forms/Ocr/BinaryOcrTrain.Designer.cs | 1 + src/ui/Forms/Ocr/BinaryOcrTrain.cs | 8 +++++- .../Ocr/VobSubCharactersImport.Designer.cs | 1 + src/ui/Forms/Ocr/VobSubCharactersImport.cs | 7 +++++ src/ui/Forms/Ocr/VobSubNOcrTrain.Designer.cs | 2 ++ src/ui/Forms/Ocr/VobSubNOcrTrain.cs | 10 +++++++ .../Forms/Options/SettingsProfile.Designer.cs | 2 ++ src/ui/Forms/Options/SettingsProfile.cs | 10 +++++++ src/ui/Forms/PluginsGet.cs | 2 +- src/ui/Forms/ProfileChoose.Designer.cs | 3 ++- src/ui/Forms/ProfileChoose.cs | 7 +++++ .../RemoveTextFromHearImpaired.Designer.cs | 3 ++- src/ui/Forms/RemoveTextFromHearImpaired.cs | 8 ++++-- src/ui/Forms/RestoreAutoBackup.Designer.cs | 5 ++-- src/ui/Forms/RestoreAutoBackup.cs | 9 ++----- src/ui/Forms/ShowHistory.Designer.cs | 2 ++ src/ui/Forms/ShowHistory.cs | 10 +++++++ src/ui/Forms/Split.Designer.cs | 5 ++-- src/ui/Forms/Split.cs | 6 +---- src/ui/Forms/SplitLongLines.Designer.cs | 3 ++- src/ui/Forms/SplitLongLines.cs | 7 +++++ .../YouTubeAnnotationsImport.Designer.cs | 2 ++ src/ui/Forms/YouTubeAnnotationsImport.cs | 11 ++++++++ 62 files changed, 278 insertions(+), 55 deletions(-) diff --git a/src/ui/Forms/AddWaveformBatch.Designer.cs b/src/ui/Forms/AddWaveformBatch.Designer.cs index d73cb6819..5cfb50f76 100644 --- a/src/ui/Forms/AddWaveformBatch.Designer.cs +++ b/src/ui/Forms/AddWaveformBatch.Designer.cs @@ -267,6 +267,8 @@ this.ShowInTaskbar = false; this.Text = "AddWaveformBatch"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AddWaveformBatch_KeyDown); + this.ResizeEnd += new System.EventHandler(this.AddWaveformBatch_ResizeEnd); + this.Shown += new System.EventHandler(this.AddWaveformBatch_Shown); this.groupBoxInput.ResumeLayout(false); this.groupBoxInput.PerformLayout(); this.contextMenuStripFiles.ResumeLayout(false); diff --git a/src/ui/Forms/AddWaveformBatch.cs b/src/ui/Forms/AddWaveformBatch.cs index 5c2dcd12e..f0c9df1fd 100644 --- a/src/ui/Forms/AddWaveformBatch.cs +++ b/src/ui/Forms/AddWaveformBatch.cs @@ -429,6 +429,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void AddWaveformBatch_ResizeEnd(object sender, EventArgs e) + { + listViewInputFiles.Columns[listViewInputFiles.Columns.Count - 1].Width = -2; + } + + private void AddWaveformBatch_Shown(object sender, EventArgs e) + { + AddWaveformBatch_ResizeEnd(sender, e); + } + private void contextMenuStripFiles_Opening(object sender, System.ComponentModel.CancelEventArgs e) { if (listViewInputFiles.Items.Count == 0) diff --git a/src/ui/Forms/ApplyDurationLimits.Designer.cs b/src/ui/Forms/ApplyDurationLimits.Designer.cs index 3f04f0d9c..783ea77d2 100644 --- a/src/ui/Forms/ApplyDurationLimits.Designer.cs +++ b/src/ui/Forms/ApplyDurationLimits.Designer.cs @@ -320,8 +320,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Apply duration limits"; - this.Shown += new System.EventHandler(this.ApplyDurationLimits_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ApplyDurationLimits_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ApplyDurationLimits_ResizeEnd); + this.Shown += new System.EventHandler(this.ApplyDurationLimits_Shown); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDurationMax)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDurationMin)).EndInit(); this.groupBoxFixesAvailable.ResumeLayout(false); diff --git a/src/ui/Forms/ApplyDurationLimits.cs b/src/ui/Forms/ApplyDurationLimits.cs index e7a0b5343..982279e94 100644 --- a/src/ui/Forms/ApplyDurationLimits.cs +++ b/src/ui/Forms/ApplyDurationLimits.cs @@ -260,8 +260,14 @@ namespace Nikse.SubtitleEdit.Forms GeneratePreview(); } + private void ApplyDurationLimits_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + } + private void ApplyDurationLimits_Shown(object sender, EventArgs e) { + ApplyDurationLimits_ResizeEnd(sender, e); listViewFixes.Focus(); } diff --git a/src/ui/Forms/AutoBreakUnbreakLines.Designer.cs b/src/ui/Forms/AutoBreakUnbreakLines.Designer.cs index d2a2567fe..fe2aa3f51 100644 --- a/src/ui/Forms/AutoBreakUnbreakLines.Designer.cs +++ b/src/ui/Forms/AutoBreakUnbreakLines.Designer.cs @@ -184,6 +184,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "AutoBreakUnbreakLines"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AutoBreakUnbreakLinesKeyDown); + this.ResizeEnd += new System.EventHandler(this.AutoBreakUnbreakLines_ResizeEnd); + this.Shown += new System.EventHandler(this.AutoBreakUnbreakLines_Shown); this.groupBoxLinesFound.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); diff --git a/src/ui/Forms/AutoBreakUnbreakLines.cs b/src/ui/Forms/AutoBreakUnbreakLines.cs index a286055b0..df777e573 100644 --- a/src/ui/Forms/AutoBreakUnbreakLines.cs +++ b/src/ui/Forms/AutoBreakUnbreakLines.cs @@ -175,6 +175,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void AutoBreakUnbreakLines_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + } + + private void AutoBreakUnbreakLines_Shown(object sender, EventArgs e) + { + AutoBreakUnbreakLines_ResizeEnd(sender, e); + } + private void AddToListView(Paragraph p, string newText) { var item = new ListViewItem(string.Empty) { Tag = p, Checked = true }; diff --git a/src/ui/Forms/BatchConvert.cs b/src/ui/Forms/BatchConvert.cs index 89e490003..53679ea37 100644 --- a/src/ui/Forms/BatchConvert.cs +++ b/src/ui/Forms/BatchConvert.cs @@ -2690,7 +2690,7 @@ namespace Nikse.SubtitleEdit.Forms private void BatchConvert_Shown(object sender, EventArgs e) { - BatchConvert_ResizeEnd(this, EventArgs.Empty); + BatchConvert_ResizeEnd(sender, e); } private void BatchConvert_ResizeEnd(object sender, EventArgs e) diff --git a/src/ui/Forms/BookmarksGoTo.Designer.cs b/src/ui/Forms/BookmarksGoTo.Designer.cs index 826fbce05..f09a8e429 100644 --- a/src/ui/Forms/BookmarksGoTo.Designer.cs +++ b/src/ui/Forms/BookmarksGoTo.Designer.cs @@ -110,6 +110,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "BookmarksGoTo"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.BookmarksGoTo_KeyDown); + this.ResizeEnd += new System.EventHandler(this.BookmarksGoTo_ResizeEnd); + this.Shown += new System.EventHandler(this.BookmarksGoTo_Shown); this.ResumeLayout(false); } diff --git a/src/ui/Forms/BookmarksGoTo.cs b/src/ui/Forms/BookmarksGoTo.cs index 626fd66a4..aa66d11b0 100644 --- a/src/ui/Forms/BookmarksGoTo.cs +++ b/src/ui/Forms/BookmarksGoTo.cs @@ -72,5 +72,15 @@ namespace Nikse.SubtitleEdit.Forms e.SuppressKeyPress = true; } } + + private void BookmarksGoTo_ResizeEnd(object sender, EventArgs e) + { + listViewBookmarks.Columns[listViewBookmarks.Columns.Count - 1].Width = -2; + } + + private void BookmarksGoTo_Shown(object sender, EventArgs e) + { + BookmarksGoTo_ResizeEnd(sender, e); + } } } diff --git a/src/ui/Forms/ChangeCasingNames.Designer.cs b/src/ui/Forms/ChangeCasingNames.Designer.cs index df3ab04d4..23d213db1 100644 --- a/src/ui/Forms/ChangeCasingNames.Designer.cs +++ b/src/ui/Forms/ChangeCasingNames.Designer.cs @@ -310,8 +310,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Change casing - Names"; - this.Shown += new System.EventHandler(this.ChangeCasingNames_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ChangeCasingNames_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ChangeCasingNames_ResizeEnd); + this.Shown += new System.EventHandler(this.ChangeCasingNames_Shown); this.groupBoxNames.ResumeLayout(false); this.groupBoxNames.PerformLayout(); this.groupBoxLinesFound.ResumeLayout(false); diff --git a/src/ui/Forms/ChangeCasingNames.cs b/src/ui/Forms/ChangeCasingNames.cs index 179813954..e5b35542f 100644 --- a/src/ui/Forms/ChangeCasingNames.cs +++ b/src/ui/Forms/ChangeCasingNames.cs @@ -253,8 +253,15 @@ namespace Nikse.SubtitleEdit.Forms GeneratePreview(); } + private void ChangeCasingNames_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + listViewNames.Columns[listViewNames.Columns.Count - 1].Width = -2; + } + private void ChangeCasingNames_Shown(object sender, EventArgs e) { + ChangeCasingNames_ResizeEnd(sender, e); listViewNames.ItemChecked += ListViewNamesItemChecked; } diff --git a/src/ui/Forms/ChooseEncoding.Designer.cs b/src/ui/Forms/ChooseEncoding.Designer.cs index c19aa0e5b..9a5716b78 100644 --- a/src/ui/Forms/ChooseEncoding.Designer.cs +++ b/src/ui/Forms/ChooseEncoding.Designer.cs @@ -170,8 +170,10 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Choose encoding"; - this.Load += new System.EventHandler(this.ChooseEncoding_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormChooseEncoding_KeyDown); + this.Load += new System.EventHandler(this.ChooseEncoding_Load); + this.ResizeEnd += new System.EventHandler(this.ChooseEncoding_ResizeEnd); + this.Shown += new System.EventHandler(this.ChooseEncoding_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/ui/Forms/ChooseEncoding.cs b/src/ui/Forms/ChooseEncoding.cs index dd46a318f..018357ea3 100644 --- a/src/ui/Forms/ChooseEncoding.cs +++ b/src/ui/Forms/ChooseEncoding.cs @@ -73,6 +73,14 @@ namespace Nikse.SubtitleEdit.Forms listView1.EndUpdate(); } + private void ChooseEncoding_Load(object sender, EventArgs e) + { + if (listView1.SelectedItems.Count >= 1) + { + listView1.EnsureVisible(listView1.SelectedItems[0].Index); + } + } + private void FormChooseEncoding_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) @@ -81,6 +89,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void ChooseEncoding_ResizeEnd(object sender, EventArgs e) + { + listView1.Columns[listView1.Columns.Count - 1].Width = -2; + } + + private void ChooseEncoding_Shown(object sender, EventArgs e) + { + ChooseEncoding_ResizeEnd(sender, e); + } + internal Encoding GetEncoding() { return _encoding; @@ -114,14 +132,6 @@ namespace Nikse.SubtitleEdit.Forms } } - private void ChooseEncoding_Load(object sender, EventArgs e) - { - if (listView1.SelectedItems.Count >= 1) - { - listView1.EnsureVisible(listView1.SelectedItems[0].Index); - } - } - private void listView1_ColumnClick(object sender, ColumnClickEventArgs e) { ListViewSorter sorter = (ListViewSorter)listView1.ListViewItemSorter; diff --git a/src/ui/Forms/ChooseStyle.Designer.cs b/src/ui/Forms/ChooseStyle.Designer.cs index 594f8b1e8..7a5f61830 100644 --- a/src/ui/Forms/ChooseStyle.Designer.cs +++ b/src/ui/Forms/ChooseStyle.Designer.cs @@ -146,6 +146,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Choose style"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ChooseStyle_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ChooseStyle_ResizeEnd); + this.Shown += new System.EventHandler(this.ChooseStyle_Shown); this.groupBoxStyles.ResumeLayout(false); this.ResumeLayout(false); diff --git a/src/ui/Forms/ChooseStyle.cs b/src/ui/Forms/ChooseStyle.cs index e1fcd0d46..8404f83c9 100644 --- a/src/ui/Forms/ChooseStyle.cs +++ b/src/ui/Forms/ChooseStyle.cs @@ -47,6 +47,15 @@ namespace Nikse.SubtitleEdit.Forms DialogResult = DialogResult.Cancel; } } + private void ChooseStyle_ResizeEnd(object sender, EventArgs e) + { + listViewStyles.Columns[listViewStyles.Columns.Count - 1].Width = -2; + } + + private void ChooseStyle_Shown(object sender, EventArgs e) + { + ChooseStyle_ResizeEnd(sender, e); + } private void buttonOK_Click(object sender, EventArgs e) { diff --git a/src/ui/Forms/ExportCustomText.Designer.cs b/src/ui/Forms/ExportCustomText.Designer.cs index bd75ae7af..3dc9d1115 100644 --- a/src/ui/Forms/ExportCustomText.Designer.cs +++ b/src/ui/Forms/ExportCustomText.Designer.cs @@ -262,6 +262,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Export custom text format"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ExportCustomText_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ExportCustomText_ResizeEnd); + this.Shown += new System.EventHandler(this.ExportCustomText_Shown); this.contextMenuStrip1.ResumeLayout(false); this.groupBoxFormats.ResumeLayout(false); this.groupBoxPreview.ResumeLayout(false); diff --git a/src/ui/Forms/ExportCustomText.cs b/src/ui/Forms/ExportCustomText.cs index 7b20a95c8..a6c201526 100644 --- a/src/ui/Forms/ExportCustomText.cs +++ b/src/ui/Forms/ExportCustomText.cs @@ -337,6 +337,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void ExportCustomText_ResizeEnd(object sender, EventArgs e) + { + listViewTemplates.Columns[listViewTemplates.Columns.Count - 1].Width = -2; + } + + private void ExportCustomText_Shown(object sender, EventArgs e) + { + ExportCustomText_ResizeEnd(sender, e); + } + private void buttonDelete_Click(object sender, EventArgs e) { Delete(); diff --git a/src/ui/Forms/ExportPngXml.Designer.cs b/src/ui/Forms/ExportPngXml.Designer.cs index 4eefaa0bc..2c46aa764 100644 --- a/src/ui/Forms/ExportPngXml.Designer.cs +++ b/src/ui/Forms/ExportPngXml.Designer.cs @@ -1075,10 +1075,10 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ExportPngXml"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ExportPngXml_FormClosing); - this.Shown += new System.EventHandler(this.ExportPngXml_Shown); - this.ResizeEnd += new System.EventHandler(this.ExportPngXml_ResizeEnd); - this.SizeChanged += new System.EventHandler(this.ExportPngXml_SizeChanged); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ExportPngXml_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ExportPngXml_ResizeEnd); + this.Shown += new System.EventHandler(this.ExportPngXml_Shown); + this.SizeChanged += new System.EventHandler(this.ExportPngXml_SizeChanged); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.contextMenuStrip1.ResumeLayout(false); this.groupBoxImageSettings.ResumeLayout(false); diff --git a/src/ui/Forms/ExportPngXml.cs b/src/ui/Forms/ExportPngXml.cs index f27dbc660..eac5eb5cc 100644 --- a/src/ui/Forms/ExportPngXml.cs +++ b/src/ui/Forms/ExportPngXml.cs @@ -4898,7 +4898,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine + private void ExportPngXml_Shown(object sender, EventArgs e) { _isLoading = false; - subtitleListView1_SelectedIndexChanged(null, null); + ExportPngXml_ResizeEnd(sender, e); } private void comboBoxHAlign_SelectedIndexChanged(object sender, EventArgs e) diff --git a/src/ui/Forms/FixCommonErrors.cs b/src/ui/Forms/FixCommonErrors.cs index 99c297176..7daa9fba7 100644 --- a/src/ui/Forms/FixCommonErrors.cs +++ b/src/ui/Forms/FixCommonErrors.cs @@ -308,7 +308,7 @@ namespace Nikse.SubtitleEdit.Forms groupBoxStep1.Visible = true; listView1.Columns[0].Width = 50; listView1.Columns[1].Width = 310; - listView1.Columns[2].Width = 400; + listView1.Columns[2].Width = -2; UiUtil.InitializeSubtitleFont(textBoxListViewText); UiUtil.InitializeSubtitleFont(subtitleListView1); @@ -1781,6 +1781,8 @@ namespace Nikse.SubtitleEdit.Forms public void ListViewFixesAutoSizeAllColumns() { + listView1.Columns[listView1.Columns.Count - 1].Width = -2; + using (var graphics = CreateGraphics()) { var timestampSizeF = graphics.MeasureString(listViewFixes.Columns[0].Text, Font); // Apply diff --git a/src/ui/Forms/ImportImages.Designer.cs b/src/ui/Forms/ImportImages.Designer.cs index 1f2efec2c..89b5ba61d 100644 --- a/src/ui/Forms/ImportImages.Designer.cs +++ b/src/ui/Forms/ImportImages.Designer.cs @@ -197,6 +197,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ImportImages"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ImportImages_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ImportImages_ResizeEnd); + this.Shown += new System.EventHandler(this.ImportImages_Shown); this.groupBoxInput.ResumeLayout(false); this.groupBoxInput.PerformLayout(); this.contextMenuStrip1.ResumeLayout(false); diff --git a/src/ui/Forms/ImportImages.cs b/src/ui/Forms/ImportImages.cs index afa1cb180..a05abc752 100644 --- a/src/ui/Forms/ImportImages.cs +++ b/src/ui/Forms/ImportImages.cs @@ -165,6 +165,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void ImportImages_ResizeEnd(object sender, EventArgs e) + { + listViewInputFiles.Columns[listViewInputFiles.Columns.Count - 1].Width = -2; + } + + private void ImportImages_Shown(object sender, EventArgs e) + { + ImportImages_ResizeEnd(sender, e); + } + private void contextMenuStrip1_Opening(object sender, System.ComponentModel.CancelEventArgs e) { if (listViewInputFiles.Items.Count == 0) diff --git a/src/ui/Forms/ImportText.Designer.cs b/src/ui/Forms/ImportText.Designer.cs index 2d3dac0a8..204f92c02 100644 --- a/src/ui/Forms/ImportText.Designer.cs +++ b/src/ui/Forms/ImportText.Designer.cs @@ -714,8 +714,9 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Import text"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ImportText_FormClosing); - this.Shown += new System.EventHandler(this.ImportText_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ImportTextKeyDown); + this.ResizeEnd += new System.EventHandler(this.ImportText_ResizeEnd); + this.Shown += new System.EventHandler(this.ImportText_Shown); this.groupBoxImportText.ResumeLayout(false); this.groupBoxImportText.PerformLayout(); this.contextMenuStripListView.ResumeLayout(false); diff --git a/src/ui/Forms/ImportText.cs b/src/ui/Forms/ImportText.cs index 499abbbb5..6c1e1fa90 100644 --- a/src/ui/Forms/ImportText.cs +++ b/src/ui/Forms/ImportText.cs @@ -1323,8 +1323,15 @@ namespace Nikse.SubtitleEdit.Forms listViewInputFiles.Items.Clear(); } + private void ImportText_ResizeEnd(object sender, EventArgs e) + { + listViewInputFiles.Columns[listViewInputFiles.Columns.Count - 1].Width = -2; + } + private void ImportText_Shown(object sender, EventArgs e) { + ImportText_ResizeEnd(sender, e); + if (textBoxText.Visible && textBoxText.Text.Length > 20) { buttonOK.Focus(); diff --git a/src/ui/Forms/JoinSubtitles.Designer.cs b/src/ui/Forms/JoinSubtitles.Designer.cs index c4a522b69..4adeafb61 100644 --- a/src/ui/Forms/JoinSubtitles.Designer.cs +++ b/src/ui/Forms/JoinSubtitles.Designer.cs @@ -250,9 +250,9 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Join subtitles"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.JoinSubtitles_FormClosing); - this.Shown += new System.EventHandler(this.JoinSubtitles_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.JoinSubtitles_KeyDown); this.Resize += new System.EventHandler(this.JoinSubtitles_Resize); + this.Shown += new System.EventHandler(this.JoinSubtitles_Shown); this.groupBoxPreview.ResumeLayout(false); this.groupBoxPreview.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownAddMs)).EndInit(); diff --git a/src/ui/Forms/JoinSubtitles.cs b/src/ui/Forms/JoinSubtitles.cs index de7675e06..c513cb363 100644 --- a/src/ui/Forms/JoinSubtitles.cs +++ b/src/ui/Forms/JoinSubtitles.cs @@ -259,7 +259,7 @@ namespace Nikse.SubtitleEdit.Forms private void JoinSubtitles_Resize(object sender, EventArgs e) { - columnHeaderFileName.Width = -2; + JoinSubtitles_Resize(this, EventArgs.Empty); } private void ButtonAddSubtitleClick(object sender, EventArgs e) diff --git a/src/ui/Forms/MatroskaSubtitleChooser.Designer.cs b/src/ui/Forms/MatroskaSubtitleChooser.Designer.cs index 1d4ad68b3..1662eacca 100644 --- a/src/ui/Forms/MatroskaSubtitleChooser.Designer.cs +++ b/src/ui/Forms/MatroskaSubtitleChooser.Designer.cs @@ -160,6 +160,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Choose subtitle from Matroska file"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormMatroskaSubtitleChooser_KeyDown); + this.ResizeEnd += new System.EventHandler(this.FormMatroskaSubtitleChooser_ResizeEnd); + this.Shown += new System.EventHandler(this.FormMatroskaSubtitleChooser_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/ui/Forms/MatroskaSubtitleChooser.cs b/src/ui/Forms/MatroskaSubtitleChooser.cs index 139b09a00..ff05daf2d 100644 --- a/src/ui/Forms/MatroskaSubtitleChooser.cs +++ b/src/ui/Forms/MatroskaSubtitleChooser.cs @@ -77,6 +77,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void FormMatroskaSubtitleChooser_ResizeEnd(object sender, EventArgs e) + { + listView1.Columns[listView1.Columns.Count - 1].Width = -2; + } + + private void FormMatroskaSubtitleChooser_Shown(object sender, EventArgs e) + { + FormMatroskaSubtitleChooser_ResizeEnd(sender, e); + } + private void ButtonOkClick(object sender, EventArgs e) { DialogResult = DialogResult.OK; diff --git a/src/ui/Forms/MergeDoubleLines.Designer.cs b/src/ui/Forms/MergeDoubleLines.Designer.cs index 9bb1b6ee1..b1b2bad5b 100644 --- a/src/ui/Forms/MergeDoubleLines.Designer.cs +++ b/src/ui/Forms/MergeDoubleLines.Designer.cs @@ -227,9 +227,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Merge lines with same text"; - this.Shown += new System.EventHandler(this.MergeDoubleLines_Shown); - this.ResizeEnd += new System.EventHandler(this.MergeDoubleLines_ResizeEnd); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MergeDoubleLines_KeyDown); + this.ResizeEnd += new System.EventHandler(this.MergeDoubleLines_ResizeEnd); + this.Shown += new System.EventHandler(this.MergeDoubleLines_Shown); this.groupBoxLinesFound.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxMillisecondsBetweenLines)).EndInit(); this.contextMenuStrip1.ResumeLayout(false); diff --git a/src/ui/Forms/MergeDoubleLines.cs b/src/ui/Forms/MergeDoubleLines.cs index 2d83f27b1..c73390624 100644 --- a/src/ui/Forms/MergeDoubleLines.cs +++ b/src/ui/Forms/MergeDoubleLines.cs @@ -55,7 +55,6 @@ namespace Nikse.SubtitleEdit.Forms SubtitleListview1.AutoSizeAllColumns(this); NumberOfMerges = 0; _subtitle = subtitle; - MergeDoubleLines_ResizeEnd(null, null); } private void AddToListView(Paragraph p, string lineNumbers, string newText) @@ -292,6 +291,8 @@ namespace Nikse.SubtitleEdit.Forms private void MergeDoubleLines_Shown(object sender, EventArgs e) { + MergeDoubleLines_ResizeEnd(sender, e); + GeneratePreview(); listViewFixes.Focus(); if (listViewFixes.Items.Count > 0) diff --git a/src/ui/Forms/MergeShortLines.Designer.cs b/src/ui/Forms/MergeShortLines.Designer.cs index 0af707bc6..0d4cf4407 100644 --- a/src/ui/Forms/MergeShortLines.Designer.cs +++ b/src/ui/Forms/MergeShortLines.Designer.cs @@ -272,8 +272,9 @@ namespace Nikse.SubtitleEdit.Forms this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "MergeShortLines"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MergeShortLines_FormClosing); - this.Shown += new System.EventHandler(this.MergeShortLines_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MergeShortLines_KeyDown); + this.ResizeEnd += new System.EventHandler(this.MergeShortLines_ResizeEnd); + this.Shown += new System.EventHandler(this.MergeShortLines_Shown); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxCharacters)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxMillisecondsBetweenLines)).EndInit(); this.groupBoxLinesFound.ResumeLayout(false); diff --git a/src/ui/Forms/MergeShortLines.cs b/src/ui/Forms/MergeShortLines.cs index aac3da8f7..7ca96387c 100644 --- a/src/ui/Forms/MergeShortLines.cs +++ b/src/ui/Forms/MergeShortLines.cs @@ -285,8 +285,15 @@ namespace Nikse.SubtitleEdit.Forms groupBoxLinesFound.Text = string.Format(LanguageSettings.Current.MergedShortLines.NumberOfMergesX, NumberOfMerges); } + private void MergeShortLines_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + } + private void MergeShortLines_Shown(object sender, EventArgs e) { + MergeShortLines_ResizeEnd(sender, e); + GeneratePreview(); listViewFixes.Focus(); if (listViewFixes.Items.Count > 0) diff --git a/src/ui/Forms/MergeTextWithSameTimeCodes.Designer.cs b/src/ui/Forms/MergeTextWithSameTimeCodes.Designer.cs index 35f979818..a2a64304b 100644 --- a/src/ui/Forms/MergeTextWithSameTimeCodes.Designer.cs +++ b/src/ui/Forms/MergeTextWithSameTimeCodes.Designer.cs @@ -224,9 +224,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "MergeTextWithSameTimeCodes"; - this.Shown += new System.EventHandler(this.MergeTextWithSameTimeCodes_Shown); - this.ResizeEnd += new System.EventHandler(this.MergeTextWithSameTimeCodes_ResizeEnd); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MergeTextWithSameTimeCodes_KeyDown); + this.ResizeEnd += new System.EventHandler(this.MergeTextWithSameTimeCodes_ResizeEnd); + this.Shown += new System.EventHandler(this.MergeTextWithSameTimeCodes_Shown); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxMillisecondsBetweenLines)).EndInit(); this.groupBoxLinesFound.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); diff --git a/src/ui/Forms/MergeTextWithSameTimeCodes.cs b/src/ui/Forms/MergeTextWithSameTimeCodes.cs index dc14a1e39..94974375f 100644 --- a/src/ui/Forms/MergeTextWithSameTimeCodes.cs +++ b/src/ui/Forms/MergeTextWithSameTimeCodes.cs @@ -55,7 +55,6 @@ namespace Nikse.SubtitleEdit.Forms SubtitleListview1.AutoSizeAllColumns(this); NumberOfMerges = 0; _subtitle = subtitle; - MergeTextWithSameTimeCodes_ResizeEnd(null, null); _language = LanguageAutoDetect.AutoDetectGoogleLanguage(subtitle); } @@ -200,6 +199,8 @@ namespace Nikse.SubtitleEdit.Forms private void MergeTextWithSameTimeCodes_Shown(object sender, EventArgs e) { + MergeTextWithSameTimeCodes_ResizeEnd(sender, e); + GeneratePreview(); listViewFixes.Focus(); if (listViewFixes.Items.Count > 0) diff --git a/src/ui/Forms/ModifySelection.Designer.cs b/src/ui/Forms/ModifySelection.Designer.cs index 3dec0fcea..31ed4982e 100644 --- a/src/ui/Forms/ModifySelection.Designer.cs +++ b/src/ui/Forms/ModifySelection.Designer.cs @@ -342,6 +342,7 @@ this.Text = "Create/modify selection"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ModifySelection_KeyDown); this.Resize += new System.EventHandler(this.ModifySelection_Resize); + this.Shown += new System.EventHandler(this.ModifySelection_Shown); this.groupBoxWhatToDo.ResumeLayout(false); this.groupBoxWhatToDo.PerformLayout(); this.groupBoxRule.ResumeLayout(false); diff --git a/src/ui/Forms/ModifySelection.cs b/src/ui/Forms/ModifySelection.cs index d645252d5..7a6e961cf 100644 --- a/src/ui/Forms/ModifySelection.cs +++ b/src/ui/Forms/ModifySelection.cs @@ -136,7 +136,6 @@ namespace Nikse.SubtitleEdit.Forms { listViewFixes.Columns.Remove(columnHeaderStyle); } - ModifySelection_Resize(null, null); _loading = false; Preview(); @@ -545,6 +544,12 @@ namespace Nikse.SubtitleEdit.Forms private void ModifySelection_Resize(object sender, EventArgs e) { listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + listViewStyles.Columns[listViewStyles.Columns.Count - 1].Width = -2; + } + + private void ModifySelection_Shown(object sender, EventArgs e) + { + ModifySelection_Resize(sender, e); } private void listViewStyles_ItemChecked(object sender, ItemCheckedEventArgs e) diff --git a/src/ui/Forms/NetflixFixErrors.cs b/src/ui/Forms/NetflixFixErrors.cs index be8a0df03..617e5b034 100644 --- a/src/ui/Forms/NetflixFixErrors.cs +++ b/src/ui/Forms/NetflixFixErrors.cs @@ -324,7 +324,7 @@ namespace Nikse.SubtitleEdit.Forms private void NetflixFixErrors_Shown(object sender, EventArgs e) { - NetflixFixErrors_ResizeEnd(this, EventArgs.Empty); + NetflixFixErrors_ResizeEnd(sender, e); } } } diff --git a/src/ui/Forms/Networking/NetworkChat.Designer.cs b/src/ui/Forms/Networking/NetworkChat.Designer.cs index 11320364f..3d6584e1c 100644 --- a/src/ui/Forms/Networking/NetworkChat.Designer.cs +++ b/src/ui/Forms/Networking/NetworkChat.Designer.cs @@ -143,6 +143,8 @@ this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "NetworkChat"; + this.ResizeEnd += new System.EventHandler(this.NetworkChat_ResizeEnd); + this.Shown += new System.EventHandler(this.NetworkChat_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/ui/Forms/Networking/NetworkChat.cs b/src/ui/Forms/Networking/NetworkChat.cs index d6a346606..cdcc7dc6a 100644 --- a/src/ui/Forms/Networking/NetworkChat.cs +++ b/src/ui/Forms/Networking/NetworkChat.cs @@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Forms.Networking { public sealed partial class NetworkChat : Form { - private Logic.Networking.NikseWebServiceSession _networkSession; + private NikseWebServiceSession _networkSession; protected override bool ShowWithoutActivation => true; @@ -119,5 +119,16 @@ namespace Nikse.SubtitleEdit.Forms.Networking listViewUsers.Items.Remove(removeItem); } } + + private void NetworkChat_ResizeEnd(object sender, EventArgs e) + { + listViewChat.Columns[listViewChat.Columns.Count - 1].Width = -2; + listViewUsers.Columns[listViewUsers.Columns.Count - 1].Width = -2; + } + + private void NetworkChat_Shown(object sender, EventArgs e) + { + NetworkChat_ResizeEnd(sender, e); + } } } diff --git a/src/ui/Forms/Ocr/BinaryOcrTrain.Designer.cs b/src/ui/Forms/Ocr/BinaryOcrTrain.Designer.cs index 5d7f54d43..c69438b2c 100644 --- a/src/ui/Forms/Ocr/BinaryOcrTrain.Designer.cs +++ b/src/ui/Forms/Ocr/BinaryOcrTrain.Designer.cs @@ -483,6 +483,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Binary image compare - train"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BinaryOcrTrain_FormClosing); + this.ResizeEnd += new System.EventHandler(this.BinaryOcrTrain_ResizeEnd); this.Shown += new System.EventHandler(this.BinaryOcrTrain_Shown); this.groupBoxTrainingOptions.ResumeLayout(false); this.groupBoxTrainingOptions.PerformLayout(); diff --git a/src/ui/Forms/Ocr/BinaryOcrTrain.cs b/src/ui/Forms/Ocr/BinaryOcrTrain.cs index 37e886815..6eff9300f 100644 --- a/src/ui/Forms/Ocr/BinaryOcrTrain.cs +++ b/src/ui/Forms/Ocr/BinaryOcrTrain.cs @@ -350,6 +350,11 @@ namespace Nikse.SubtitleEdit.Forms.Ocr _autoDetectFontText = text; } + private void BinaryOcrTrain_ResizeEnd(object sender, EventArgs e) + { + listViewFonts.Columns[listViewFonts.Columns.Count - 1].Width = -2; + } + private void BinaryOcrTrain_Shown(object sender, EventArgs e) { if (string.IsNullOrEmpty(_autoDetectFontText)) @@ -357,7 +362,8 @@ namespace Nikse.SubtitleEdit.Forms.Ocr return; } - SelectAll_Click(null, null); + BinaryOcrTrain_ResizeEnd(sender, e); + SelectAll_Click(this, EventArgs.Empty); int numberOfCharactersLearned = 0; int numberOfCharactersSkipped = 0; foreach (ListViewItem fontItem in listViewFonts.CheckedItems) diff --git a/src/ui/Forms/Ocr/VobSubCharactersImport.Designer.cs b/src/ui/Forms/Ocr/VobSubCharactersImport.Designer.cs index 05b0f446f..f3d6641dd 100644 --- a/src/ui/Forms/Ocr/VobSubCharactersImport.Designer.cs +++ b/src/ui/Forms/Ocr/VobSubCharactersImport.Designer.cs @@ -207,6 +207,7 @@ this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.ResizeEnd += new System.EventHandler(this.VobSubCharactersImport_ResizeEnd); this.Shown += new System.EventHandler(this.VobSubCharactersImport_Shown); this.groupBoxCurrentImage.ResumeLayout(false); this.groupBoxCurrentImage.PerformLayout(); diff --git a/src/ui/Forms/Ocr/VobSubCharactersImport.cs b/src/ui/Forms/Ocr/VobSubCharactersImport.cs index 159b49d79..d105092a6 100644 --- a/src/ui/Forms/Ocr/VobSubCharactersImport.cs +++ b/src/ui/Forms/Ocr/VobSubCharactersImport.cs @@ -37,8 +37,15 @@ namespace Nikse.SubtitleEdit.Forms.Ocr buttonCancel.Text = LanguageSettings.Current.General.Cancel; } + private void VobSubCharactersImport_ResizeEnd(object sender, EventArgs e) + { + listView1.Columns[listView1.Columns.Count - 1].Width = -2; + } + private void VobSubCharactersImport_Shown(object sender, EventArgs e) { + VobSubCharactersImport_ResizeEnd(sender, e); + openFileDialog1.Filter = "Binary OCR db files|*.db"; openFileDialog1.FileName = string.Empty; openFileDialog1.InitialDirectory = Configuration.OcrDirectory; diff --git a/src/ui/Forms/Ocr/VobSubNOcrTrain.Designer.cs b/src/ui/Forms/Ocr/VobSubNOcrTrain.Designer.cs index cba66883a..3ff384c68 100644 --- a/src/ui/Forms/Ocr/VobSubNOcrTrain.Designer.cs +++ b/src/ui/Forms/Ocr/VobSubNOcrTrain.Designer.cs @@ -385,6 +385,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "nOCR Train"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.VobSubNOcrTrain_FormClosing); + this.ResizeEnd += new System.EventHandler(this.VobSubNOcrTrain_ResizeEnd); + this.Shown += new System.EventHandler(this.VobSubNOcrTrain_Shown); this.groupBoxTrainingOptions.ResumeLayout(false); this.groupBoxTrainingOptions.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSegmentsPerCharacter)).EndInit(); diff --git a/src/ui/Forms/Ocr/VobSubNOcrTrain.cs b/src/ui/Forms/Ocr/VobSubNOcrTrain.cs index f217bb591..1d70c3df2 100644 --- a/src/ui/Forms/Ocr/VobSubNOcrTrain.cs +++ b/src/ui/Forms/Ocr/VobSubNOcrTrain.cs @@ -404,5 +404,15 @@ namespace Nikse.SubtitleEdit.Forms.Ocr Configuration.Settings.Tools.OcrTrainSrtFile = textBoxInputFile.Text; Configuration.Settings.Tools.OcrTrainMergedLetters = textBoxMerged.Text; } + + private void VobSubNOcrTrain_ResizeEnd(object sender, EventArgs e) + { + listViewFonts.Columns[listViewFonts.Columns.Count - 1].Width = -2; + } + + private void VobSubNOcrTrain_Shown(object sender, EventArgs e) + { + VobSubNOcrTrain_ResizeEnd(sender, e); + } } } diff --git a/src/ui/Forms/Options/SettingsProfile.Designer.cs b/src/ui/Forms/Options/SettingsProfile.Designer.cs index d2b598948..4694a8703 100644 --- a/src/ui/Forms/Options/SettingsProfile.Designer.cs +++ b/src/ui/Forms/Options/SettingsProfile.Designer.cs @@ -650,6 +650,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Profiles"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SettingsProfile_KeyDown); + this.ResizeEnd += new System.EventHandler(this.SettingsProfile_ResizeEnd); + this.Shown += new System.EventHandler(this.SettingsProfile_Shown); this.groupBoxStyles.ResumeLayout(false); this.groupBoxStyles.PerformLayout(); this.groupBoxGeneralRules.ResumeLayout(false); diff --git a/src/ui/Forms/Options/SettingsProfile.cs b/src/ui/Forms/Options/SettingsProfile.cs index d5c08490a..3d41fb233 100644 --- a/src/ui/Forms/Options/SettingsProfile.cs +++ b/src/ui/Forms/Options/SettingsProfile.cs @@ -119,6 +119,16 @@ namespace Nikse.SubtitleEdit.Forms.Options } } + private void SettingsProfile_ResizeEnd(object sender, EventArgs e) + { + listViewProfiles.Columns[listViewProfiles.Columns.Count - 1].Width = -2; + } + + private void SettingsProfile_Shown(object sender, EventArgs e) + { + SettingsProfile_ResizeEnd(sender, e); + } + private void buttonRemoveAll_Click(object sender, EventArgs e) { RulesProfiles.Clear(); diff --git a/src/ui/Forms/PluginsGet.cs b/src/ui/Forms/PluginsGet.cs index 071b47769..bfa797848 100644 --- a/src/ui/Forms/PluginsGet.cs +++ b/src/ui/Forms/PluginsGet.cs @@ -411,7 +411,7 @@ namespace Nikse.SubtitleEdit.Forms private void PluginsGet_Shown(object sender, EventArgs e) { - PluginsGet_ResizeEnd(this, EventArgs.Empty); + PluginsGet_ResizeEnd(sender, e); } private void buttonRemove_Click(object sender, EventArgs e) diff --git a/src/ui/Forms/ProfileChoose.Designer.cs b/src/ui/Forms/ProfileChoose.Designer.cs index 84b0a83f5..1ebb49bb6 100644 --- a/src/ui/Forms/ProfileChoose.Designer.cs +++ b/src/ui/Forms/ProfileChoose.Designer.cs @@ -128,8 +128,9 @@ this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ProfileChoose"; - this.Shown += new System.EventHandler(this.ProfileChoose_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ProfileChoose_KeyDown); + this.ResizeEnd += new System.EventHandler(this.ProfileChoose_ResizeEnd); + this.Shown += new System.EventHandler(this.ProfileChoose_Shown); this.ResumeLayout(false); } diff --git a/src/ui/Forms/ProfileChoose.cs b/src/ui/Forms/ProfileChoose.cs index f8ba8973b..d530b2949 100644 --- a/src/ui/Forms/ProfileChoose.cs +++ b/src/ui/Forms/ProfileChoose.cs @@ -119,8 +119,15 @@ namespace Nikse.SubtitleEdit.Forms } } + private void ProfileChoose_ResizeEnd(object sender, EventArgs e) + { + listViewProfiles.Columns[listViewProfiles.Columns.Count - 1].Width = -2; + } + private void ProfileChoose_Shown(object sender, EventArgs e) { + ProfileChoose_ResizeEnd(sender, e); + if (listViewProfiles.SelectedIndices.Count == 0) { return; diff --git a/src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs b/src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs index ed85b5caa..9ea43ae4c 100644 --- a/src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs +++ b/src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs @@ -480,9 +480,10 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Remove text for hearing impaired"; - this.Load += new System.EventHandler(this.FormRemoveTextForHearImpaired_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormRemoveTextForHearImpaired_KeyDown); + this.Load += new System.EventHandler(this.FormRemoveTextForHearImpaired_Load); this.Resize += new System.EventHandler(this.FormRemoveTextForHearImpaired_Resize); + this.Shown += new System.EventHandler(this.FormRemoveTextForHearImpaired_Shown); this.groupBoxLinesFound.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.groupBoxRemoveTextConditions.ResumeLayout(false); diff --git a/src/ui/Forms/RemoveTextFromHearImpaired.cs b/src/ui/Forms/RemoveTextFromHearImpaired.cs index b865e03ac..b5af8fec1 100644 --- a/src/ui/Forms/RemoveTextFromHearImpaired.cs +++ b/src/ui/Forms/RemoveTextFromHearImpaired.cs @@ -271,9 +271,13 @@ namespace Nikse.SubtitleEdit.Forms private void FormRemoveTextForHearImpaired_Resize(object sender, EventArgs e) { int availableWidth = (listViewFixes.Width - (columnHeaderApply.Width + columnHeaderLine.Width + 20)) / 2; - columnHeaderBefore.Width = availableWidth; - columnHeaderAfter.Width = availableWidth; + columnHeaderAfter.Width = -2; + } + + private void FormRemoveTextForHearImpaired_Shown(object sender, EventArgs e) + { + FormRemoveTextForHearImpaired_Resize(sender, e); } private void checkBoxRemoveTextBeforeColon_CheckedChanged(object sender, EventArgs e) diff --git a/src/ui/Forms/RestoreAutoBackup.Designer.cs b/src/ui/Forms/RestoreAutoBackup.Designer.cs index 52f271a75..9a2dd959a 100644 --- a/src/ui/Forms/RestoreAutoBackup.Designer.cs +++ b/src/ui/Forms/RestoreAutoBackup.Designer.cs @@ -155,10 +155,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Restore auto-backup"; - this.Shown += new System.EventHandler(this.RestoreAutoBackup_Shown); - this.ResizeEnd += new System.EventHandler(this.RestoreAutoBackup_ResizeEnd); - this.SizeChanged += new System.EventHandler(this.RestoreAutoBackup_SizeChanged); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RestoreAutoBackup_KeyDown); + this.ResizeEnd += new System.EventHandler(this.RestoreAutoBackup_ResizeEnd); + this.Shown += new System.EventHandler(this.RestoreAutoBackup_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/ui/Forms/RestoreAutoBackup.cs b/src/ui/Forms/RestoreAutoBackup.cs index 713288ec9..cfa849245 100644 --- a/src/ui/Forms/RestoreAutoBackup.cs +++ b/src/ui/Forms/RestoreAutoBackup.cs @@ -49,7 +49,7 @@ namespace Nikse.SubtitleEdit.Forms private void RestoreAutoBackup_Shown(object sender, EventArgs e) { - listViewBackups.Columns[2].Width = -2; + RestoreAutoBackup_ResizeEnd(sender, e); if (Directory.Exists(Configuration.AutoBackupDirectory)) { _files = Directory.GetFiles(Configuration.AutoBackupDirectory, "*.*"); @@ -137,12 +137,7 @@ namespace Nikse.SubtitleEdit.Forms private void RestoreAutoBackup_ResizeEnd(object sender, EventArgs e) { - listViewBackups.Columns[2].Width = -2; - } - - private void RestoreAutoBackup_SizeChanged(object sender, EventArgs e) - { - listViewBackups.Columns[2].Width = -2; + listViewBackups.Columns[listViewBackups.Columns.Count - 1].Width = -2; } private void linkLabelOpenContainingFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) diff --git a/src/ui/Forms/ShowHistory.Designer.cs b/src/ui/Forms/ShowHistory.Designer.cs index 8deddac71..8452a5045 100644 --- a/src/ui/Forms/ShowHistory.Designer.cs +++ b/src/ui/Forms/ShowHistory.Designer.cs @@ -139,6 +139,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "History (for undo)"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormShowHistory_KeyDown); + this.ResizeEnd += new System.EventHandler(this.FormShowHistory_ResizeEnd); + this.Shown += new System.EventHandler(this.FormShowHistory_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/ui/Forms/ShowHistory.cs b/src/ui/Forms/ShowHistory.cs index 10b695405..c32780f6b 100644 --- a/src/ui/Forms/ShowHistory.cs +++ b/src/ui/Forms/ShowHistory.cs @@ -74,6 +74,16 @@ namespace Nikse.SubtitleEdit.Forms } } + private void FormShowHistory_ResizeEnd(object sender, EventArgs e) + { + listViewHistory.Columns[listViewHistory.Columns.Count - 1].Width = -2; + } + + private void FormShowHistory_Shown(object sender, EventArgs e) + { + FormShowHistory_ResizeEnd(sender, e); + } + private void ButtonOkClick(object sender, EventArgs e) { if (listViewHistory.SelectedItems.Count > 0) diff --git a/src/ui/Forms/Split.Designer.cs b/src/ui/Forms/Split.Designer.cs index 29442abbf..3b0b96093 100644 --- a/src/ui/Forms/Split.Designer.cs +++ b/src/ui/Forms/Split.Designer.cs @@ -373,10 +373,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Split"; - this.Shown += new System.EventHandler(this.Split_Shown); - this.ResizeEnd += new System.EventHandler(this.Split_ResizeEnd); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Split_KeyDown); - this.Resize += new System.EventHandler(this.Split_Resize); + this.ResizeEnd += new System.EventHandler(this.Split_ResizeEnd); + this.Shown += new System.EventHandler(this.Split_Shown); this.groupBoxSplitOptions.ResumeLayout(false); this.groupBoxSplitOptions.PerformLayout(); this.groupBoxSubtitleInfo.ResumeLayout(false); diff --git a/src/ui/Forms/Split.cs b/src/ui/Forms/Split.cs index ba52a6962..5396c2c46 100644 --- a/src/ui/Forms/Split.cs +++ b/src/ui/Forms/Split.cs @@ -311,14 +311,10 @@ namespace Nikse.SubtitleEdit.Forms private void Split_Shown(object sender, EventArgs e) { _loading = false; + Split_ResizeEnd(sender, e); CalculateParts(); } - private void Split_Resize(object sender, EventArgs e) - { - columnHeaderFileName.Width = -2; - } - private void Split_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) diff --git a/src/ui/Forms/SplitLongLines.Designer.cs b/src/ui/Forms/SplitLongLines.Designer.cs index 1beca80d1..4a303aca6 100644 --- a/src/ui/Forms/SplitLongLines.Designer.cs +++ b/src/ui/Forms/SplitLongLines.Designer.cs @@ -322,8 +322,9 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Split long lines"; - this.Shown += new System.EventHandler(this.SplitLongLines_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SplitLongLines_KeyDown); + this.ResizeEnd += new System.EventHandler(this.SplitLongLines_ResizeEnd); + this.Shown += new System.EventHandler(this.SplitLongLines_Shown); this.groupBoxLinesFound.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSingleLineMaxCharacters)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLineMaxCharacters)).EndInit(); diff --git a/src/ui/Forms/SplitLongLines.cs b/src/ui/Forms/SplitLongLines.cs index c1d984a47..64a379e56 100644 --- a/src/ui/Forms/SplitLongLines.cs +++ b/src/ui/Forms/SplitLongLines.cs @@ -355,8 +355,15 @@ namespace Nikse.SubtitleEdit.Forms } } + private void SplitLongLines_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + } + private void SplitLongLines_Shown(object sender, EventArgs e) { + SplitLongLines_ResizeEnd(sender, e); + GeneratePreview(true); listViewFixes.Focus(); if (listViewFixes.Items.Count > 0) diff --git a/src/ui/Forms/YouTubeAnnotationsImport.Designer.cs b/src/ui/Forms/YouTubeAnnotationsImport.Designer.cs index ccffb65f0..e18a671c4 100644 --- a/src/ui/Forms/YouTubeAnnotationsImport.Designer.cs +++ b/src/ui/Forms/YouTubeAnnotationsImport.Designer.cs @@ -109,6 +109,8 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "YouTubeAnnotationsImport"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.YouTubeAnnotationsImport_KeyDown); + this.ResizeEnd += new System.EventHandler(this.YouTubeAnnotationsImport_ResizeEnd); + this.Shown += new System.EventHandler(this.YouTubeAnnotationsImport_Shown); this.ResumeLayout(false); } diff --git a/src/ui/Forms/YouTubeAnnotationsImport.cs b/src/ui/Forms/YouTubeAnnotationsImport.cs index adf5f6c6a..ff441c42f 100644 --- a/src/ui/Forms/YouTubeAnnotationsImport.cs +++ b/src/ui/Forms/YouTubeAnnotationsImport.cs @@ -1,4 +1,5 @@ using Nikse.SubtitleEdit.Logic; +using System; using System.Collections.Generic; using System.Windows.Forms; @@ -51,5 +52,15 @@ namespace Nikse.SubtitleEdit.Forms DialogResult = DialogResult.Cancel; } } + + private void YouTubeAnnotationsImport_ResizeEnd(object sender, EventArgs e) + { + listViewFixes.Columns[listViewFixes.Columns.Count - 1].Width = -2; + } + + private void YouTubeAnnotationsImport_Shown(object sender, EventArgs e) + { + YouTubeAnnotationsImport_ResizeEnd(sender, e); + } } } From f753a9db5382a101fbad756cbc1f774748f37f4b Mon Sep 17 00:00:00 2001 From: OmrSi Date: Fri, 22 Jan 2021 18:57:52 +0200 Subject: [PATCH 2/3] Set dark theme for export forms --- src/ui/Forms/MultipleReplaceExportImport.cs | 1 + src/ui/Forms/Options/SettingsProfileExport.cs | 1 + src/ui/Forms/Styles/SubStationAlphaStylesExport.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/ui/Forms/MultipleReplaceExportImport.cs b/src/ui/Forms/MultipleReplaceExportImport.cs index 081f6f1a5..f1886962a 100644 --- a/src/ui/Forms/MultipleReplaceExportImport.cs +++ b/src/ui/Forms/MultipleReplaceExportImport.cs @@ -17,6 +17,7 @@ namespace Nikse.SubtitleEdit.Forms public MultipleReplaceExportImport(List groups, bool export) { InitializeComponent(); + UiUtil.FixFonts(this); _groups = groups; _export = export; diff --git a/src/ui/Forms/Options/SettingsProfileExport.cs b/src/ui/Forms/Options/SettingsProfileExport.cs index 79fa07903..5dbc7aaf6 100644 --- a/src/ui/Forms/Options/SettingsProfileExport.cs +++ b/src/ui/Forms/Options/SettingsProfileExport.cs @@ -14,6 +14,7 @@ namespace Nikse.SubtitleEdit.Forms.Options public SettingsProfileExport(List profiles) { InitializeComponent(); + UiUtil.FixFonts(this); listViewExportStyles.Columns[0].Width = listViewExportStyles.Width - 20; foreach (var profile in profiles) diff --git a/src/ui/Forms/Styles/SubStationAlphaStylesExport.cs b/src/ui/Forms/Styles/SubStationAlphaStylesExport.cs index 6843ce3e3..1f124bd99 100644 --- a/src/ui/Forms/Styles/SubStationAlphaStylesExport.cs +++ b/src/ui/Forms/Styles/SubStationAlphaStylesExport.cs @@ -20,6 +20,7 @@ namespace Nikse.SubtitleEdit.Forms.Styles public SubStationAlphaStylesExport(string header, bool isSubStationAlpha, SubtitleFormat format) { InitializeComponent(); + UiUtil.FixFonts(this); _header = header; _isSubStationAlpha = isSubStationAlpha; From 313de181fb8eeaf1d97f9543310948d9f1f2d055 Mon Sep 17 00:00:00 2001 From: OmrSi Date: Fri, 22 Jan 2021 18:58:49 +0200 Subject: [PATCH 3/3] Change "RemoveTextFromHearImpaired" to "RemoveTextForHearImpaired" --- ...signer.cs => RemoveTextForHearImpaired.Designer.cs} | 0 ...romHearImpaired.cs => RemoveTextForHearImpaired.cs} | 0 ...earImpaired.resx => RemoveTextForHearImpaired.resx} | 0 src/ui/SubtitleEdit.csproj | 10 +++++----- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/ui/Forms/{RemoveTextFromHearImpaired.Designer.cs => RemoveTextForHearImpaired.Designer.cs} (100%) rename src/ui/Forms/{RemoveTextFromHearImpaired.cs => RemoveTextForHearImpaired.cs} (100%) rename src/ui/Forms/{RemoveTextFromHearImpaired.resx => RemoveTextForHearImpaired.resx} (100%) diff --git a/src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs b/src/ui/Forms/RemoveTextForHearImpaired.Designer.cs similarity index 100% rename from src/ui/Forms/RemoveTextFromHearImpaired.Designer.cs rename to src/ui/Forms/RemoveTextForHearImpaired.Designer.cs diff --git a/src/ui/Forms/RemoveTextFromHearImpaired.cs b/src/ui/Forms/RemoveTextForHearImpaired.cs similarity index 100% rename from src/ui/Forms/RemoveTextFromHearImpaired.cs rename to src/ui/Forms/RemoveTextForHearImpaired.cs diff --git a/src/ui/Forms/RemoveTextFromHearImpaired.resx b/src/ui/Forms/RemoveTextForHearImpaired.resx similarity index 100% rename from src/ui/Forms/RemoveTextFromHearImpaired.resx rename to src/ui/Forms/RemoveTextForHearImpaired.resx diff --git a/src/ui/SubtitleEdit.csproj b/src/ui/SubtitleEdit.csproj index fa54eaed6..bc9bcce8c 100644 --- a/src/ui/SubtitleEdit.csproj +++ b/src/ui/SubtitleEdit.csproj @@ -784,11 +784,11 @@ OCRSpellCheck.cs - + Form - - RemoveTextFromHearImpaired.cs + + RemoveTextForHearImpaired.cs Form @@ -1529,8 +1529,8 @@ MergeShortLines.cs - - RemoveTextFromHearImpaired.cs + + RemoveTextForHearImpaired.cs Designer