From a578d923a6071d394b767179433c2830adbba35c Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 27 Apr 2020 19:40:06 +0200 Subject: [PATCH] Minor fixes for translation space/width - thx Andrebavila :) Related to comment https://github.com/SubtitleEdit/subtitleedit/issues/4131#issuecomment-620068311 in #4131 --- src/Forms/ExportPngXml.Designer.cs | 1 + src/Forms/Settings.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Forms/ExportPngXml.Designer.cs b/src/Forms/ExportPngXml.Designer.cs index 8dfd32123..256b56bdc 100644 --- a/src/Forms/ExportPngXml.Designer.cs +++ b/src/Forms/ExportPngXml.Designer.cs @@ -617,6 +617,7 @@ // comboBoxResolution // this.comboBoxResolution.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxResolution.DropDownWidth = 160; this.comboBoxResolution.FormattingEnabled = true; this.comboBoxResolution.Items.AddRange(new object[] { "4K (4096x2160)", diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index 93d32ba5a..cb966b9cc 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -472,6 +472,22 @@ namespace Nikse.SubtitleEdit.Forms comboBoxSplitBehavior.SelectedIndex = gs.SplitBehavior; labelSplitBehavior.Text = language.SplitBehavior; comboBoxSplitBehavior.Left = labelTimeCodeMode.Left + labelTimeCodeMode.Width + 4; + if (labelSplitBehavior.Width > labelTimeCodeMode.Width) + { + comboBoxSplitBehavior.Left = labelSplitBehavior.Left + labelSplitBehavior.Width + 4; + } + + var dropDownSplitBehaviorWidth = comboBoxSplitBehavior.Width; + using (var g = Graphics.FromHwnd(IntPtr.Zero)) + { + foreach (var item in comboBoxSplitBehavior.Items) + { + var itemWidth = (int)g.MeasureString((string)item, Font).Width + 5; + dropDownSplitBehaviorWidth = Math.Max(itemWidth, dropDownSplitBehaviorWidth); + } + } + comboBoxSplitBehavior.DropDownWidth = dropDownSplitBehaviorWidth; + comboBoxAutoBackup.Items[0] = Configuration.Settings.Language.General.None; comboBoxAutoBackup.Items[1] = language.AutoBackupEveryMinute;