mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
- Generates undo entry when changing layer via the edit box.
- Adds SetLayer entry in LanguageStructure.MainControls - Only shows layer input control for ASSA files.
This commit is contained in:
commit
24cefe7f2b
@ -1474,6 +1474,7 @@ To use an API key, go to "Options -> Settings -> Tools" to enter your Goog
|
||||
<Next>Next ></Next>
|
||||
<AutoBreak>Auto &br</AutoBreak>
|
||||
<Unbreak>Unbreak</Unbreak>
|
||||
<SetLayer>Set layer</SetLayer>
|
||||
</Controls>
|
||||
<VideoControls>
|
||||
<Translate>Translate</Translate>
|
||||
|
2
src/ui/Forms/Main.Designer.cs
generated
2
src/ui/Forms/Main.Designer.cs
generated
@ -4583,7 +4583,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.numericUpDownLayer.Name = "numericUpDownLayer";
|
||||
this.numericUpDownLayer.Size = new System.Drawing.Size(37, 20);
|
||||
this.numericUpDownLayer.TabIndex = 46;
|
||||
this.numericUpDownLayer.ValueChanged += new System.EventHandler(this.numericUpDownLayer_ValueChanged);
|
||||
this.numericUpDownLayer.ValueChanged += new System.EventHandler(this.NumericUpDownLayer_ValueChanged);
|
||||
//
|
||||
// labelLayer
|
||||
//
|
||||
|
@ -10768,7 +10768,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void numericUpDownLayer_ValueChanged(object sender, EventArgs e)
|
||||
private void NumericUpDownLayer_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
var idx = _subtitleListViewIndex;
|
||||
var p = _subtitle.GetParagraphOrDefault(idx);
|
||||
@ -10777,7 +10777,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
p.Layer = (int)numericUpDownLayer.Value;
|
||||
var format = GetCurrentSubtitleFormat();
|
||||
bool isAssa = format.GetType() == typeof(AdvancedSubStationAlpha);
|
||||
if (isAssa)
|
||||
{
|
||||
int layer = (int)numericUpDownLayer.Value;
|
||||
MakeHistoryForUndo(LanguageSettings.Current.Main.Controls.SetLayer + ": " + layer);
|
||||
p.Layer = layer;
|
||||
}
|
||||
}
|
||||
|
||||
public Point GetPositionInForm(Control ctrl)
|
||||
@ -12917,9 +12924,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
textBoxListViewText.Text = p.Text;
|
||||
textBoxListViewText.TextChanged += TextBoxListViewTextTextChanged;
|
||||
_listViewTextUndoLast = p.Text;
|
||||
numericUpDownLayer.ValueChanged -= numericUpDownLayer_ValueChanged;
|
||||
numericUpDownLayer.Value = p.Layer;
|
||||
numericUpDownLayer.ValueChanged += numericUpDownLayer_ValueChanged;
|
||||
|
||||
var format = GetCurrentSubtitleFormat();
|
||||
bool isAssa = format.GetType() == typeof(AdvancedSubStationAlpha);
|
||||
numericUpDownLayer.Visible = isAssa;
|
||||
labelLayer.Visible = isAssa;
|
||||
if (isAssa)
|
||||
{
|
||||
numericUpDownLayer.ValueChanged -= NumericUpDownLayer_ValueChanged;
|
||||
numericUpDownLayer.Value = p.Layer;
|
||||
numericUpDownLayer.ValueChanged += NumericUpDownLayer_ValueChanged;
|
||||
}
|
||||
|
||||
timeUpDownStartTime.MaskedTextBox.TextChanged -= MaskedTextBoxTextChanged;
|
||||
timeUpDownStartTime.TimeCode = p.StartTime;
|
||||
|
@ -2040,7 +2040,8 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Previous = "< Prev",
|
||||
Next = "Next >",
|
||||
AutoBreak = "Auto &br",
|
||||
Unbreak = "Unbreak"
|
||||
Unbreak = "Unbreak",
|
||||
SetLayer = "Set Layer"
|
||||
},
|
||||
|
||||
VideoControls = new LanguageStructure.Main.MainVideoControls
|
||||
|
@ -1898,6 +1898,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public string Next { get; set; }
|
||||
public string AutoBreak { get; set; }
|
||||
public string Unbreak { get; set; }
|
||||
public string SetLayer { get; set; }
|
||||
}
|
||||
|
||||
public class MainVideoControls
|
||||
|
Loading…
Reference in New Issue
Block a user