mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Add dialog style preview tooltip
This commit is contained in:
parent
00238ef0b7
commit
c6250c6e26
@ -410,6 +410,24 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
return pre + s.TrimStart().TrimStart(GetDashChar(), GetAlternateDashChar()).TrimStart();
|
||||
}
|
||||
|
||||
public static string GetDialogStylePreview(DialogType dialogType)
|
||||
{
|
||||
var line1 = "Lorem ipsum dolor sit amet.";
|
||||
var line2 = "Donec eget turpis consequat.";
|
||||
|
||||
switch (dialogType)
|
||||
{
|
||||
case DialogType.DashBothLinesWithoutSpace:
|
||||
return "-" + line1 + "\n" + "-" + line2;
|
||||
case DialogType.DashSecondLineWithSpace:
|
||||
return line1 + "\n" + "- " + line2;
|
||||
case DialogType.DashSecondLineWithoutSpace:
|
||||
return line1 + "\n" + "-" + line2;
|
||||
default:
|
||||
return "- " + line1 + "\n" + "- " + line2;
|
||||
}
|
||||
}
|
||||
|
||||
public static DialogType GetDialogStyleFromIndex(int index)
|
||||
{
|
||||
switch (index)
|
||||
|
10
src/ui/Forms/Options/Settings.Designer.cs
generated
10
src/ui/Forms/Options/Settings.Designer.cs
generated
@ -427,6 +427,7 @@
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.labelUpdateFileTypeAssociationsStatus = new System.Windows.Forms.Label();
|
||||
this.imageListFileTypeAssociations = new System.Windows.Forms.ImageList(this.components);
|
||||
this.toolTipDialogStylePreview = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.panelGeneral.SuspendLayout();
|
||||
this.groupBoxMiscellaneous.SuspendLayout();
|
||||
this.groupBoxGeneralRules.SuspendLayout();
|
||||
@ -2883,7 +2884,7 @@
|
||||
this.checkBoxWaveformSnapToShotChanges.AutoSize = true;
|
||||
this.checkBoxWaveformSnapToShotChanges.Location = new System.Drawing.Point(262, 161);
|
||||
this.checkBoxWaveformSnapToShotChanges.Name = "checkBoxWaveformSnapToShotChanges";
|
||||
this.checkBoxWaveformSnapToShotChanges.Size = new System.Drawing.Size(249, 17);
|
||||
this.checkBoxWaveformSnapToShotChanges.Size = new System.Drawing.Size(242, 17);
|
||||
this.checkBoxWaveformSnapToShotChanges.TabIndex = 26;
|
||||
this.checkBoxWaveformSnapToShotChanges.Text = "Snap to shot changes (hold Shift to override)";
|
||||
this.checkBoxWaveformSnapToShotChanges.UseVisualStyleBackColor = true;
|
||||
@ -5124,6 +5125,12 @@
|
||||
this.imageListFileTypeAssociations.ImageSize = new System.Drawing.Size(32, 32);
|
||||
this.imageListFileTypeAssociations.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// toolTipDialogStylePreview
|
||||
//
|
||||
this.toolTipDialogStylePreview.AutoPopDelay = 60000;
|
||||
this.toolTipDialogStylePreview.InitialDelay = 500;
|
||||
this.toolTipDialogStylePreview.ReshowDelay = 100;
|
||||
//
|
||||
// Settings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -5671,5 +5678,6 @@
|
||||
private System.Windows.Forms.ComboBox comboBoxCpsLineLenCalc;
|
||||
private System.Windows.Forms.Label labelCpsLineLenCalc;
|
||||
private System.Windows.Forms.CheckBox checkBoxUseWordSplitList;
|
||||
private System.Windows.Forms.ToolTip toolTipDialogStylePreview;
|
||||
}
|
||||
}
|
@ -1151,19 +1151,24 @@ namespace Nikse.SubtitleEdit.Forms.Options
|
||||
comboBoxDialogStyle.Items.Add(LanguageSettings.Current.Settings.DialogStyleDashSecondLineWithSpace);
|
||||
comboBoxDialogStyle.Items.Add(LanguageSettings.Current.Settings.DialogStyleDashSecondLineWithoutSpace);
|
||||
comboBoxDialogStyle.SelectedIndex = 0;
|
||||
toolTipDialogStylePreview.RemoveAll();
|
||||
switch (dialogStyle)
|
||||
{
|
||||
case DialogType.DashBothLinesWithSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 0;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashBothLinesWithSpace));
|
||||
break;
|
||||
case DialogType.DashBothLinesWithoutSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 1;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashBothLinesWithoutSpace));
|
||||
break;
|
||||
case DialogType.DashSecondLineWithSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 2;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashSecondLineWithSpace));
|
||||
break;
|
||||
case DialogType.DashSecondLineWithoutSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 3;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashSecondLineWithoutSpace));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3534,6 +3539,9 @@ namespace Nikse.SubtitleEdit.Forms.Options
|
||||
|
||||
toolTipContinuationPreview.RemoveAll();
|
||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(_rulesProfiles[idx].ContinuationStyle));
|
||||
|
||||
toolTipDialogStylePreview.RemoveAll();
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(_rulesProfiles[idx].DialogStyle));
|
||||
}
|
||||
|
||||
private void checkBoxToolsBreakByPixelWidth_CheckedChanged(object sender, EventArgs e)
|
||||
|
@ -138,4 +138,7 @@
|
||||
<metadata name="imageListFileTypeAssociations.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTipDialogStylePreview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1007, 37</value>
|
||||
</metadata>
|
||||
</root>
|
46
src/ui/Forms/Options/SettingsProfile.Designer.cs
generated
46
src/ui/Forms/Options/SettingsProfile.Designer.cs
generated
@ -33,6 +33,8 @@
|
||||
this.labelName = new System.Windows.Forms.Label();
|
||||
this.textBoxName = new System.Windows.Forms.TextBox();
|
||||
this.groupBoxGeneralRules = new System.Windows.Forms.GroupBox();
|
||||
this.comboBoxCpsLineLenCalc = new System.Windows.Forms.ComboBox();
|
||||
this.labelCpsLineLenCalc = new System.Windows.Forms.Label();
|
||||
this.comboBoxContinuationStyle = new System.Windows.Forms.ComboBox();
|
||||
this.labelContinuationStyle = new System.Windows.Forms.Label();
|
||||
this.labelDialogStyle = new System.Windows.Forms.Label();
|
||||
@ -71,8 +73,7 @@
|
||||
this.buttonOK = new System.Windows.Forms.Button();
|
||||
this.openFileDialogImport = new System.Windows.Forms.OpenFileDialog();
|
||||
this.toolTipContinuationPreview = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.comboBoxCpsLineLenCalc = new System.Windows.Forms.ComboBox();
|
||||
this.labelCpsLineLenCalc = new System.Windows.Forms.Label();
|
||||
this.toolTipDialogStylePreview = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.groupBoxStyles.SuspendLayout();
|
||||
this.groupBoxGeneralRules.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownOptimalCharsSec)).BeginInit();
|
||||
@ -160,6 +161,25 @@
|
||||
this.groupBoxGeneralRules.TabStop = false;
|
||||
this.groupBoxGeneralRules.Text = "Rules";
|
||||
//
|
||||
// comboBoxCpsLineLenCalc
|
||||
//
|
||||
this.comboBoxCpsLineLenCalc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxCpsLineLenCalc.DropDownWidth = 170;
|
||||
this.comboBoxCpsLineLenCalc.FormattingEnabled = true;
|
||||
this.comboBoxCpsLineLenCalc.Location = new System.Drawing.Point(132, 313);
|
||||
this.comboBoxCpsLineLenCalc.Name = "comboBoxCpsLineLenCalc";
|
||||
this.comboBoxCpsLineLenCalc.Size = new System.Drawing.Size(174, 21);
|
||||
this.comboBoxCpsLineLenCalc.TabIndex = 197;
|
||||
//
|
||||
// labelCpsLineLenCalc
|
||||
//
|
||||
this.labelCpsLineLenCalc.AutoSize = true;
|
||||
this.labelCpsLineLenCalc.Location = new System.Drawing.Point(4, 316);
|
||||
this.labelCpsLineLenCalc.Name = "labelCpsLineLenCalc";
|
||||
this.labelCpsLineLenCalc.Size = new System.Drawing.Size(102, 13);
|
||||
this.labelCpsLineLenCalc.TabIndex = 196;
|
||||
this.labelCpsLineLenCalc.Text = "Cps/line length style";
|
||||
//
|
||||
// comboBoxContinuationStyle
|
||||
//
|
||||
this.comboBoxContinuationStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
@ -627,24 +647,11 @@
|
||||
this.toolTipContinuationPreview.InitialDelay = 500;
|
||||
this.toolTipContinuationPreview.ReshowDelay = 100;
|
||||
//
|
||||
// comboBoxCpsLineLenCalc
|
||||
// toolTipDialogStylePreview
|
||||
//
|
||||
this.comboBoxCpsLineLenCalc.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxCpsLineLenCalc.DropDownWidth = 170;
|
||||
this.comboBoxCpsLineLenCalc.FormattingEnabled = true;
|
||||
this.comboBoxCpsLineLenCalc.Location = new System.Drawing.Point(132, 313);
|
||||
this.comboBoxCpsLineLenCalc.Name = "comboBoxCpsLineLenCalc";
|
||||
this.comboBoxCpsLineLenCalc.Size = new System.Drawing.Size(174, 21);
|
||||
this.comboBoxCpsLineLenCalc.TabIndex = 197;
|
||||
//
|
||||
// labelCpsLineLenCalc
|
||||
//
|
||||
this.labelCpsLineLenCalc.AutoSize = true;
|
||||
this.labelCpsLineLenCalc.Location = new System.Drawing.Point(4, 316);
|
||||
this.labelCpsLineLenCalc.Name = "labelCpsLineLenCalc";
|
||||
this.labelCpsLineLenCalc.Size = new System.Drawing.Size(102, 13);
|
||||
this.labelCpsLineLenCalc.TabIndex = 196;
|
||||
this.labelCpsLineLenCalc.Text = "Cps/line length style";
|
||||
this.toolTipDialogStylePreview.AutoPopDelay = 60000;
|
||||
this.toolTipDialogStylePreview.InitialDelay = 500;
|
||||
this.toolTipDialogStylePreview.ReshowDelay = 100;
|
||||
//
|
||||
// SettingsProfile
|
||||
//
|
||||
@ -725,5 +732,6 @@
|
||||
private System.Windows.Forms.ToolTip toolTipContinuationPreview;
|
||||
private System.Windows.Forms.ComboBox comboBoxCpsLineLenCalc;
|
||||
private System.Windows.Forms.Label labelCpsLineLenCalc;
|
||||
private System.Windows.Forms.ToolTip toolTipDialogStylePreview;
|
||||
}
|
||||
}
|
@ -229,6 +229,9 @@ namespace Nikse.SubtitleEdit.Forms.Options
|
||||
|
||||
toolTipContinuationPreview.RemoveAll();
|
||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(RulesProfiles[idx].ContinuationStyle));
|
||||
|
||||
toolTipDialogStylePreview.RemoveAll();
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(RulesProfiles[idx].DialogStyle));
|
||||
}
|
||||
|
||||
private void listViewProfiles_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@ -303,19 +306,24 @@ namespace Nikse.SubtitleEdit.Forms.Options
|
||||
comboBoxDialogStyle.Items.Add(LanguageSettings.Current.Settings.DialogStyleDashBothLinesWithoutSpace);
|
||||
comboBoxDialogStyle.Items.Add(LanguageSettings.Current.Settings.DialogStyleDashSecondLineWithSpace);
|
||||
comboBoxDialogStyle.Items.Add(LanguageSettings.Current.Settings.DialogStyleDashSecondLineWithoutSpace);
|
||||
toolTipDialogStylePreview.RemoveAll();
|
||||
switch (RulesProfiles[idx].DialogStyle)
|
||||
{
|
||||
case DialogType.DashBothLinesWithSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 0;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashBothLinesWithSpace));
|
||||
break;
|
||||
case DialogType.DashBothLinesWithoutSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 1;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashBothLinesWithoutSpace));
|
||||
break;
|
||||
case DialogType.DashSecondLineWithSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 2;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashSecondLineWithSpace));
|
||||
break;
|
||||
case DialogType.DashSecondLineWithoutSpace:
|
||||
comboBoxDialogStyle.SelectedIndex = 3;
|
||||
toolTipDialogStylePreview.SetToolTip(comboBoxDialogStyle, DialogSplitMerge.GetDialogStylePreview(DialogType.DashSecondLineWithoutSpace));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
@ -123,4 +123,7 @@
|
||||
<metadata name="toolTipContinuationPreview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>262, 14</value>
|
||||
</metadata>
|
||||
<metadata name="toolTipDialogStylePreview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>488, 14</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user