mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Add GOTO line feature to SyncPointSync.cs
This commit is contained in:
parent
8e7a395a00
commit
ef80213f09
@ -267,6 +267,35 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
SubtitleListview1.SelectIndexAndEnsureVisible(selectedIndex);
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
else if (e.KeyData == (Keys.Control | Keys.G))
|
||||
{
|
||||
var isSubtitleListview1Active = true;
|
||||
if (subtitleListView2 != null && subtitleListView2.Visible)
|
||||
{
|
||||
var point = PointToClient(MousePosition);
|
||||
if (point.X >= subtitleListView2.Left && point.X <= subtitleListView2.Left + subtitleListView2.Width)
|
||||
{
|
||||
isSubtitleListview1Active = false;
|
||||
}
|
||||
}
|
||||
using (var gotoForm = new GoToLine())
|
||||
{
|
||||
gotoForm.Initialize(1, isSubtitleListview1Active ? _subtitle.Paragraphs.Count : _otherSubtitle.Paragraphs.Count);
|
||||
if (gotoForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (isSubtitleListview1Active)
|
||||
{
|
||||
SubtitleListview1.Items[gotoForm.LineNumber - 1].Selected = true;
|
||||
SubtitleListview1.EnsureVisible(gotoForm.LineNumber - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitleListView2.Items[gotoForm.LineNumber - 1].Selected = true;
|
||||
subtitleListView2.EnsureVisible(gotoForm.LineNumber - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetSyncFactorLabel()
|
||||
@ -283,7 +312,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
else if (_synchronizationPoints.Count == 2)
|
||||
{
|
||||
double startPos = _synchronizationPoints.First().Value.TotalMilliseconds / TimeCode.BaseUnit;
|
||||
double endPos = _synchronizationPoints.Last().Value.TotalMilliseconds/TimeCode.BaseUnit;
|
||||
double endPos = _synchronizationPoints.Last().Value.TotalMilliseconds / TimeCode.BaseUnit;
|
||||
|
||||
double subStart = _originalSubtitle.Paragraphs[_synchronizationPoints.First().Key].StartTime.TotalMilliseconds / TimeCode.BaseUnit;
|
||||
double subEnd = _originalSubtitle.Paragraphs[_synchronizationPoints.Last().Key].StartTime.TotalMilliseconds / TimeCode.BaseUnit;
|
||||
|
Loading…
Reference in New Issue
Block a user