Add ebu stl file property icon - thx Leon :)

This commit is contained in:
niksedk 2022-08-15 21:19:00 +02:00
parent d83f9c1ad5
commit 3f61eb5d25
6 changed files with 33 additions and 23 deletions

View File

@ -1515,16 +1515,9 @@ namespace Nikse.SubtitleEdit.Controls
if (_settings.Tools.ListViewSyntaxColorGap && i >= 0 && i < paragraphs.Count - 1 && ColumnIndexGap >= 0 && !paragraph.StartTime.IsMaxTime) if (_settings.Tools.ListViewSyntaxColorGap && i >= 0 && i < paragraphs.Count - 1 && ColumnIndexGap >= 0 && !paragraph.StartTime.IsMaxTime)
{ {
Paragraph next = paragraphs[i + 1]; var next = paragraphs[i + 1];
var gapMilliseconds = (int)Math.Round(next.StartTime.TotalMilliseconds - paragraph.EndTime.TotalMilliseconds); var gapMilliseconds = (int)Math.Round(next.StartTime.TotalMilliseconds - paragraph.EndTime.TotalMilliseconds);
if (gapMilliseconds < Configuration.Settings.General.MinimumMillisecondsBetweenLines) item.SubItems[ColumnIndexGap].BackColor = gapMilliseconds < Configuration.Settings.General.MinimumMillisecondsBetweenLines ? Configuration.Settings.Tools.ListViewSyntaxErrorColor : BackColor;
{
item.SubItems[ColumnIndexGap].BackColor = Configuration.Settings.Tools.ListViewSyntaxErrorColor;
}
else
{
item.SubItems[ColumnIndexGap].BackColor = BackColor;
}
} }
if (ColumnIndexTextOriginal >= 0 && item.SubItems.Count >= ColumnIndexTextOriginal) if (ColumnIndexTextOriginal >= 0 && item.SubItems.Count >= ColumnIndexTextOriginal)
@ -1539,8 +1532,8 @@ namespace Nikse.SubtitleEdit.Controls
if (_settings.Tools.ListViewSyntaxColorLongLines) if (_settings.Tools.ListViewSyntaxColorLongLines)
{ {
string s = HtmlUtil.RemoveHtmlTags(paragraph.Text, true); var s = HtmlUtil.RemoveHtmlTags(paragraph.Text, true);
foreach (string line in s.SplitToLines()) foreach (var line in s.SplitToLines())
{ {
if (line.CountCharacters(false) > Configuration.Settings.General.SubtitleLineMaximumLength) if (line.CountCharacters(false) > Configuration.Settings.General.SubtitleLineMaximumLength)
{ {
@ -1548,7 +1541,7 @@ namespace Nikse.SubtitleEdit.Controls
return; return;
} }
} }
int noOfLines = paragraph.NumberOfLines; var noOfLines = paragraph.NumberOfLines;
if (s.CountCharacters(false) <= Configuration.Settings.General.SubtitleLineMaximumLength * noOfLines) if (s.CountCharacters(false) <= Configuration.Settings.General.SubtitleLineMaximumLength * noOfLines)
{ {
if (noOfLines > Configuration.Settings.General.MaxNumberOfLines && _settings.Tools.ListViewSyntaxMoreThanXLines) if (noOfLines > Configuration.Settings.General.MaxNumberOfLines && _settings.Tools.ListViewSyntaxMoreThanXLines)
@ -2290,29 +2283,23 @@ namespace Nikse.SubtitleEdit.Controls
return; return;
} }
var tempText = Columns[ColumnIndexTextOriginal].Text; (Columns[ColumnIndexTextOriginal].Text, Columns[ColumnIndexText].Text) = (Columns[ColumnIndexText].Text, Columns[ColumnIndexTextOriginal].Text);
Columns[ColumnIndexTextOriginal].Text = Columns[ColumnIndexText].Text; (SubtitleColumns[ColumnIndexTextOriginal], SubtitleColumns[ColumnIndexText]) = (SubtitleColumns[ColumnIndexText], SubtitleColumns[ColumnIndexTextOriginal]);
Columns[ColumnIndexText].Text = tempText;
var tempColumn = SubtitleColumns[ColumnIndexTextOriginal];
SubtitleColumns[ColumnIndexTextOriginal] = SubtitleColumns[ColumnIndexText];
SubtitleColumns[ColumnIndexText] = tempColumn;
UpdateColumnIndexes(); UpdateColumnIndexes();
BeginUpdate(); BeginUpdate();
int i = 0; var i = 0;
foreach (ListViewItem item in Items) foreach (ListViewItem item in Items)
{ {
var p = subtitle.GetParagraphOrDefault(i); var p = subtitle.GetParagraphOrDefault(i);
if (p != null) if (p != null)
{ {
item.SubItems[ColumnIndexText].Text = p.Text.Replace(Environment.NewLine, _lineSeparatorString); Columns[ColumnIndexText].Text = p.Text.Replace(Environment.NewLine, _lineSeparatorString);
} }
var original = Utilities.GetOriginalParagraph(i, p, subtitleOriginal.Paragraphs); var original = Utilities.GetOriginalParagraph(i, p, subtitleOriginal.Paragraphs);
if (original != null) if (original != null)
{ {
item.SubItems[ColumnIndexTextOriginal].Text = original.Text.Replace(Environment.NewLine, _lineSeparatorString); Columns[ColumnIndexTextOriginal].Text = original.Text.Replace(Environment.NewLine, _lineSeparatorString);
} }
i++; i++;

View File

@ -32222,6 +32222,13 @@ namespace Nikse.SubtitleEdit.Forms
toolStripButtonXProperties.ToolTipText = string.Format(_language.Menu.File.FormatXProperties, new WebVTT().Name); toolStripButtonXProperties.ToolTipText = string.Format(_language.Menu.File.FormatXProperties, new WebVTT().Name);
toolStripButtonXProperties.Image = Properties.Resources.webvtt; toolStripButtonXProperties.Image = Properties.Resources.webvtt;
} }
if (formatType == typeof(Ebu))
{
toolStripButtonXProperties.Visible = true;
toolStripButtonXProperties.ToolTipText = string.Format(_language.Menu.File.FormatXProperties, new Ebu().Name);
toolStripButtonXProperties.Image = Properties.Resources.ebu;
}
} }
private void NetflixGlyphCheck(bool isSaving) private void NetflixGlyphCheck(bool isSaving)

View File

@ -90,6 +90,16 @@ namespace Nikse.SubtitleEdit.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap ebu {
get {
object obj = ResourceManager.GetObject("ebu", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@ -148,4 +148,7 @@
<data name="itt" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="itt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\itt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\itt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="ebu" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ebu.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

BIN
src/ui/Resources/ebu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -2042,6 +2042,9 @@
<None Include="Resources\webvtt.bmp" /> <None Include="Resources\webvtt.bmp" />
<None Include="Resources\webvtt.png" /> <None Include="Resources\webvtt.png" />
<None Include="Resources\itt.png" /> <None Include="Resources\itt.png" />
<None Include="Resources\ebustl.bmp" />
<None Include="Resources\ebustl.png" />
<None Include="Resources\ebu.png" />
<Content Include="SE2.ico" /> <Content Include="SE2.ico" />
<None Include="Resources\SE.ico" /> <None Include="Resources\SE.ico" />
<None Include="Hunspellx64.dll"> <None Include="Hunspellx64.dll">