mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Add total pixel width in main window
This commit is contained in:
parent
a7e914586b
commit
663bd9d554
@ -8792,9 +8792,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (buttonUnBreak.Visible)
|
||||
{
|
||||
if (!textBoxHasFocus)
|
||||
{
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, string.Format("{0} {1}", s.Length, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, s.Length);
|
||||
}
|
||||
}
|
||||
|
||||
buttonSplitLine.Visible = true;
|
||||
}
|
||||
@ -8803,24 +8811,48 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
lineTotal.ForeColor = UiUtil.ForeColor;
|
||||
if (!textBoxHasFocus)
|
||||
{
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, string.Format("{0} {1}", s.Length, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, s.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.ForeColor = Color.Red;
|
||||
if (!textBoxHasFocus)
|
||||
{
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthXSplitLine, string.Format("{0} {1}", s.Length, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthXSplitLine, s.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if (buttonUnBreak.Visible)
|
||||
{
|
||||
if (!textBoxHasFocus)
|
||||
{
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, string.Format("{0} {1}", s.Length, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, s.Length);
|
||||
}
|
||||
}
|
||||
|
||||
var abl = Utilities.AutoBreakLine(s, "en").SplitToLines();
|
||||
if (abl.Count > maxLines || abl.Any(li => li.Length > Configuration.Settings.General.SubtitleLineMaximumLength))
|
||||
@ -8833,9 +8865,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
else
|
||||
{
|
||||
if (!textBoxHasFocus)
|
||||
{
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, string.Format("{0} {1}", s.Length, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTotal.Text = string.Format(_languageGeneral.TotalLengthX, s.Length);
|
||||
}
|
||||
}
|
||||
|
||||
var lang = LanguageAutoDetect.AutoDetectGoogleLanguage(_subtitle);
|
||||
var abl = Utilities.AutoBreakLine(s, lang).SplitToLines();
|
||||
@ -23963,7 +24003,18 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
int pos = textBox.SelectionStart;
|
||||
var s = HtmlUtil.RemoveHtmlTags(textBox.Text, true).Replace(Environment.NewLine, string.Empty); // we don't count new line in total length... correct?
|
||||
int totalLength = s.Length;
|
||||
string totalL = " " + string.Format(_languageGeneral.TotalLengthX, totalLength);
|
||||
string totalL;
|
||||
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
var totalLengthPixels = TextWidth.CalcPixelWidth(s);
|
||||
totalL = " " + string.Format(_languageGeneral.TotalLengthX, string.Format("{0} {1}", totalLength, totalLengthPixels));
|
||||
}
|
||||
else
|
||||
{
|
||||
totalL = " " + string.Format(_languageGeneral.TotalLengthX, totalLength);
|
||||
}
|
||||
|
||||
if (lineBreakPos < 0 || pos <= lineBreakPos)
|
||||
{
|
||||
lineTotal.Text = "1," + (pos + 1) + totalL;
|
||||
|
Loading…
Reference in New Issue
Block a user