Try to fix #5574 - thx OmrSi :)

Avoid being dependent on the order of stuff in the auto-generated main designer file
This commit is contained in:
Nikolaj Olsson 2021-12-07 20:10:57 +01:00
parent 9ecc6e636b
commit 464a8dd07c
3 changed files with 10 additions and 2 deletions

View File

@ -106,7 +106,9 @@ namespace Nikse.SubtitleEdit.Controls
try
{
textBox.Font = gs.SubtitleTextBoxFontBold ? new Font(gs.SubtitleFontName, gs.SubtitleTextBoxFontSize, FontStyle.Bold) : new Font(gs.SubtitleFontName, gs.SubtitleTextBoxFontSize);
var f = gs.SubtitleTextBoxFontBold ? new Font(gs.SubtitleFontName, gs.SubtitleTextBoxFontSize, FontStyle.Bold) : new Font(gs.SubtitleFontName, gs.SubtitleTextBoxFontSize);
TextBoxFont = f;
textBox.Font = f;
textBox.ForeColor = gs.SubtitleFontColor;
textBox.BackColor = gs.SubtitleBackgroundColor;
}

View File

@ -268,6 +268,8 @@ namespace Nikse.SubtitleEdit.Forms
UiUtil.FixLargeFonts(tabControlModes, buttonAutoBreak);
UiUtil.FixLargeFonts(groupBoxEdit, buttonAutoBreak);
UiUtil.InitializeSubtitleFont(textBoxSource);
UiUtil.InitializeSubtitleFont(textBoxListViewText);
UiUtil.InitializeSubtitleFont(textBoxListViewTextOriginal);
UiUtil.InitializeSubtitleFont(SubtitleListview1);
using (var graphics = CreateGraphics())

View File

@ -504,7 +504,11 @@ namespace Nikse.SubtitleEdit.Logic
control.Font = new Font(gs.SubtitleFontName, gs.SubtitleListViewFontSize);
}
}
else if (control is SETextBox || control is TextBox)
else if (control is SETextBox seTextBox)
{
seTextBox.UpdateFontAndColors(seTextBox);
}
else if (control is TextBox)
{
if (gs.SubtitleTextBoxFontBold)
{