Add context menu for enlarging font size in spell check window - thx Marko G :)

This commit is contained in:
niksedk 2022-09-24 10:49:19 +02:00
parent ef833a5758
commit ff382a454b
8 changed files with 74 additions and 2 deletions

View File

@ -96,6 +96,7 @@
<ExampleX>Example: {0}</ExampleX>
<Reset>Reset</Reset>
<Warning>Warning</Warning>
<UseLargerFontForThisWindow>Use larger font for this window</UseLargerFontForThisWindow>
</General>
<About>
<Title>About Subtitle Edit</Title>

View File

@ -124,6 +124,7 @@ namespace Nikse.SubtitleEdit.Core.Common
public string MusicSymbolReplace { get; set; }
public string UnicodeSymbolsToInsert { get; set; }
public bool SpellCheckAutoChangeNameCasing { get; set; }
public bool SpellCheckUseLargerFont { get; set; }
public bool SpellCheckAutoChangeNamesUseSuggestions { get; set; }
public bool CheckOneLetterWords { get; set; }
public bool SpellCheckEnglishAllowInQuoteAsIng { get; set; }
@ -4425,6 +4426,12 @@ $HorzAlign = Center
settings.Tools.SpellCheckAutoChangeNameCasing = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture);
}
subNode = node.SelectSingleNode("SpellCheckUseLargerFont");
if (subNode != null)
{
settings.Tools.SpellCheckUseLargerFont = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture);
}
subNode = node.SelectSingleNode("SpellCheckAutoChangeNamesUseSuggestions");
if (subNode != null)
{
@ -10059,6 +10066,7 @@ $HorzAlign = Center
textWriter.WriteElementString("MusicSymbolReplace", settings.Tools.MusicSymbolReplace);
textWriter.WriteElementString("UnicodeSymbolsToInsert", settings.Tools.UnicodeSymbolsToInsert);
textWriter.WriteElementString("SpellCheckAutoChangeNameCasing", settings.Tools.SpellCheckAutoChangeNameCasing.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("SpellCheckUseLargerFont", settings.Tools.SpellCheckUseLargerFont.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("SpellCheckAutoChangeNamesUseSuggestions", settings.Tools.SpellCheckAutoChangeNamesUseSuggestions.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("SpellCheckOneLetterWords", settings.Tools.CheckOneLetterWords.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("SpellCheckEnglishAllowInQuoteAsIng", settings.Tools.SpellCheckEnglishAllowInQuoteAsIng.ToString(CultureInfo.InvariantCulture));

View File

@ -54,6 +54,10 @@
this.pictureBoxBookmark = new System.Windows.Forms.PictureBox();
this.panelBookmark = new System.Windows.Forms.Panel();
this.labelBookmark = new System.Windows.Forms.Label();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.useLargerFontForThisWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.useLargerFontForThisWindowToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
this.groupBoxWordNotFound.SuspendLayout();
this.groupBoxSuggestions.SuspendLayout();
@ -61,6 +65,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBdSup)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBookmark)).BeginInit();
this.panelBookmark.SuspendLayout();
this.contextMenuStrip2.SuspendLayout();
this.SuspendLayout();
//
// buttonAddToDictionary
@ -127,9 +132,11 @@
this.toolStripSeparator1,
this.deleteToolStripMenuItem,
this.bookmarkCommentToolStripMenuItem,
this.openImagedBasedSourceFileToolStripMenuItem});
this.openImagedBasedSourceFileToolStripMenuItem,
this.toolStripSeparator2,
this.useLargerFontForThisWindowToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(247, 142);
this.contextMenuStrip1.Size = new System.Drawing.Size(247, 148);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStrip1Opening);
//
// addXToNamesnoiseListToolStripMenuItem
@ -461,6 +468,32 @@
this.labelBookmark.TabIndex = 0;
this.labelBookmark.Text = "labelBookmark";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(243, 6);
//
// useLargerFontForThisWindowToolStripMenuItem
//
this.useLargerFontForThisWindowToolStripMenuItem.Name = "useLargerFontForThisWindowToolStripMenuItem";
this.useLargerFontForThisWindowToolStripMenuItem.Size = new System.Drawing.Size(246, 22);
this.useLargerFontForThisWindowToolStripMenuItem.Text = "Use larger font for this window";
this.useLargerFontForThisWindowToolStripMenuItem.Click += new System.EventHandler(this.useLargerFontForThisWindowToolStripMenuItem_Click);
//
// contextMenuStrip2
//
this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.useLargerFontForThisWindowToolStripMenuItem1});
this.contextMenuStrip2.Name = "contextMenuStrip2";
this.contextMenuStrip2.Size = new System.Drawing.Size(237, 48);
//
// useLargerFontForThisWindowToolStripMenuItem1
//
this.useLargerFontForThisWindowToolStripMenuItem1.Name = "useLargerFontForThisWindowToolStripMenuItem1";
this.useLargerFontForThisWindowToolStripMenuItem1.Size = new System.Drawing.Size(236, 22);
this.useLargerFontForThisWindowToolStripMenuItem1.Text = "Use larger font for this window";
this.useLargerFontForThisWindowToolStripMenuItem1.Click += new System.EventHandler(this.useLargerFontForThisWindowToolStripMenuItem_Click);
//
// SpellCheck
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -490,6 +523,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Kom";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SpellCheck_FormClosing);
this.Shown += new System.EventHandler(this.SpellCheck_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormSpellCheck_KeyDown);
this.contextMenuStrip1.ResumeLayout(false);
this.groupBoxWordNotFound.ResumeLayout(false);
@ -502,6 +536,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBookmark)).EndInit();
this.panelBookmark.ResumeLayout(false);
this.panelBookmark.PerformLayout();
this.contextMenuStrip2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -547,5 +582,9 @@
private System.Windows.Forms.Panel panelBookmark;
private System.Windows.Forms.Label labelBookmark;
private System.Windows.Forms.ToolStripMenuItem bookmarkCommentToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem useLargerFontForThisWindowToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
private System.Windows.Forms.ToolStripMenuItem useLargerFontForThisWindowToolStripMenuItem1;
}
}

View File

@ -129,6 +129,8 @@ namespace Nikse.SubtitleEdit.Forms
buttonAddToNames.Text = LanguageSettings.Current.SpellCheck.AddToNamesAndIgnoreList;
buttonGoogleIt.Text = LanguageSettings.Current.Main.VideoControls.GoogleIt;
deleteToolStripMenuItem.Text = LanguageSettings.Current.General.DeleteCurrentLine;
useLargerFontForThisWindowToolStripMenuItem.Text = LanguageSettings.Current.General.UseLargerFontForThisWindow;
useLargerFontForThisWindowToolStripMenuItem1.Text = LanguageSettings.Current.General.UseLargerFontForThisWindow;
bookmarkCommentToolStripMenuItem.Text = LanguageSettings.Current.Settings.ToggleBookmarksWithComment;
bookmarkCommentToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.GeneralToggleBookmarksWithText);
@ -1731,5 +1733,19 @@ namespace Nikse.SubtitleEdit.Forms
pictureBoxBookmark.Hide();
}
}
private void useLargerFontForThisWindowToolStripMenuItem_Click(object sender, EventArgs e)
{
Font = useLargerFontForThisWindowToolStripMenuItem.Checked ? new Font(Font.FontFamily, Font.Size - 2, FontStyle.Regular) : new Font(Font.FontFamily, Font.Size + 2, FontStyle.Regular);
useLargerFontForThisWindowToolStripMenuItem.Checked = !useLargerFontForThisWindowToolStripMenuItem.Checked;
}
private void SpellCheck_Shown(object sender, EventArgs e)
{
if (Configuration.Settings.Tools.SpellCheckUseLargerFont)
{
useLargerFontForThisWindowToolStripMenuItem_Click(null, null);
}
}
}
}

View File

@ -120,4 +120,7 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>172, 17</value>
</metadata>
</root>

View File

@ -226,6 +226,7 @@ namespace Nikse.SubtitleEdit.Logic
ExampleX = "Example: {0}",
Reset = "Reset",
Warning = "Warning",
UseLargerFontForThisWindow = "Use larger font for this window",
};
About = new LanguageStructure.About

View File

@ -343,6 +343,9 @@ namespace Nikse.SubtitleEdit.Logic
case "General/Warning":
language.General.Warning = reader.Value;
break;
case "General/UseLargerFontForThisWindow":
language.General.UseLargerFontForThisWindow = reader.Value;
break;
case "About/Title":
language.About.Title = reader.Value;
break;

View File

@ -100,6 +100,7 @@
public string ExampleX { get; set; }
public string Reset { get; set; }
public string Warning { get; set; }
public string UseLargerFontForThisWindow { get; set; }
}
public class About