mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Work on dark theme default settings
This commit is contained in:
parent
1739f1c34b
commit
d9845b5dc4
@ -2421,7 +2421,7 @@ can edit in same subtitle file (collaboration)",
|
||||
HtmlColor = "Html color",
|
||||
AssaColor = "ASSA color",
|
||||
DarkTheme ="Dark theme",
|
||||
DarkThemeEnabled = "Dark theme enabled",
|
||||
DarkThemeEnabled = "Use dark theme",
|
||||
ListViewAndTextBox = "List view and text box",
|
||||
UpdateShortcut = "Update",
|
||||
FoucsSetVideoPosition = "Focus set video position",
|
||||
|
@ -4586,6 +4586,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var oldSubtitleTextBoxHtmlColor = Configuration.Settings.General.SubtitleTextBoxHtmlColor.ToArgb().ToString();
|
||||
var oldSubtitleTextBoxAssaColor = Configuration.Settings.General.SubtitleTextBoxAssColor.ToArgb().ToString();
|
||||
var oldUseDarkTheme = Configuration.Settings.General.UseDarkTheme;
|
||||
var oldUseDarkForeColor = Configuration.Settings.General.DarkThemeForeColor;
|
||||
var oldUseDarkBackColor = Configuration.Settings.General.DarkThemeBackColor;
|
||||
using (var settings = new Options.Settings())
|
||||
{
|
||||
settings.Initialize(Icon, toolStripButtonFileNew.Image, toolStripButtonFileOpen.Image, toolStripButtonSave.Image, toolStripButtonSaveAs.Image, toolStripButtonFind.Image,
|
||||
@ -4768,21 +4770,36 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
RefreshTimeCodeMode();
|
||||
}
|
||||
|
||||
if (oldUseDarkTheme != Configuration.Settings.General.UseDarkTheme)
|
||||
if (oldUseDarkTheme != Configuration.Settings.General.UseDarkTheme ||
|
||||
oldUseDarkForeColor != Configuration.Settings.General.DarkThemeForeColor ||
|
||||
oldUseDarkBackColor != Configuration.Settings.General.DarkThemeBackColor)
|
||||
{
|
||||
if (Configuration.Settings.General.UseDarkTheme)
|
||||
{
|
||||
OnLoad(null);
|
||||
|
||||
if (oldUseDarkTheme != Configuration.Settings.General.UseDarkTheme)
|
||||
{
|
||||
// override colors one time
|
||||
Configuration.Settings.VideoControls.WaveformDrawGrid = false;
|
||||
Configuration.Settings.VideoControls.WaveformColor = Color.FromArgb(7, 65, 152);
|
||||
Configuration.Settings.VideoControls.WaveformSelectedColor = Color.FromArgb(150, 0, 0);
|
||||
|
||||
//TODO: list view colors...
|
||||
}
|
||||
|
||||
textBoxListViewText.Initialize(Configuration.Settings.General.SubtitleTextBoxSyntaxColor);
|
||||
textBoxListViewTextAlternate.Initialize(Configuration.Settings.General.SubtitleTextBoxSyntaxColor);
|
||||
SubtitleListview1.BackColor = Configuration.Settings.General.SubtitleBackgroundColor;
|
||||
RefreshSelectedParagraph();
|
||||
SetAudioVisualizerSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
Configuration.Settings.General.SubtitleBackgroundColor = new TextBox().BackColor;
|
||||
Configuration.Settings.General.SubtitleFontColor = DefaultForeColor;
|
||||
Configuration.Settings.VideoControls.WaveformColor = Color.FromArgb(255, 160, 240, 30);
|
||||
Configuration.Settings.VideoControls.WaveformSelectedColor = Color.FromArgb(255, 230, 0, 0);
|
||||
MessageBox.Show(Configuration.Settings.Language.Main.DarkThemeRestart);
|
||||
}
|
||||
}
|
||||
|
8
src/ui/Forms/Options/Settings.Designer.cs
generated
8
src/ui/Forms/Options/Settings.Designer.cs
generated
@ -4087,9 +4087,9 @@
|
||||
this.checkBoxDarkThemeEnabled.AutoSize = true;
|
||||
this.checkBoxDarkThemeEnabled.Location = new System.Drawing.Point(16, 25);
|
||||
this.checkBoxDarkThemeEnabled.Name = "checkBoxDarkThemeEnabled";
|
||||
this.checkBoxDarkThemeEnabled.Size = new System.Drawing.Size(122, 17);
|
||||
this.checkBoxDarkThemeEnabled.Size = new System.Drawing.Size(101, 17);
|
||||
this.checkBoxDarkThemeEnabled.TabIndex = 43;
|
||||
this.checkBoxDarkThemeEnabled.Text = "Dark theme enabled";
|
||||
this.checkBoxDarkThemeEnabled.Text = "Use dark theme";
|
||||
this.checkBoxDarkThemeEnabled.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// panelDarkThemeBackColor
|
||||
@ -4099,6 +4099,7 @@
|
||||
this.panelDarkThemeBackColor.Name = "panelDarkThemeBackColor";
|
||||
this.panelDarkThemeBackColor.Size = new System.Drawing.Size(21, 20);
|
||||
this.panelDarkThemeBackColor.TabIndex = 42;
|
||||
this.panelDarkThemeBackColor.Click += new System.EventHandler(this.buttonDarkThemeBackColor_Click);
|
||||
//
|
||||
// buttonDarkThemeBackColor
|
||||
//
|
||||
@ -4108,6 +4109,7 @@
|
||||
this.buttonDarkThemeBackColor.TabIndex = 40;
|
||||
this.buttonDarkThemeBackColor.Text = "Back color";
|
||||
this.buttonDarkThemeBackColor.UseVisualStyleBackColor = true;
|
||||
this.buttonDarkThemeBackColor.Click += new System.EventHandler(this.buttonDarkThemeBackColor_Click);
|
||||
//
|
||||
// panelDarkThemeColor
|
||||
//
|
||||
@ -4116,6 +4118,7 @@
|
||||
this.panelDarkThemeColor.Name = "panelDarkThemeColor";
|
||||
this.panelDarkThemeColor.Size = new System.Drawing.Size(21, 20);
|
||||
this.panelDarkThemeColor.TabIndex = 41;
|
||||
this.panelDarkThemeColor.Click += new System.EventHandler(this.buttonDarkThemeColor_Click);
|
||||
//
|
||||
// buttonDarkThemeColor
|
||||
//
|
||||
@ -4125,6 +4128,7 @@
|
||||
this.buttonDarkThemeColor.TabIndex = 39;
|
||||
this.buttonDarkThemeColor.Text = "Color";
|
||||
this.buttonDarkThemeColor.UseVisualStyleBackColor = true;
|
||||
this.buttonDarkThemeColor.Click += new System.EventHandler(this.buttonDarkThemeColor_Click);
|
||||
//
|
||||
// labelFontNote
|
||||
//
|
||||
|
@ -3510,5 +3510,23 @@ namespace Nikse.SubtitleEdit.Forms.Options
|
||||
{
|
||||
buttonTextBoxAssColor_Click(null, null);
|
||||
}
|
||||
|
||||
private void buttonDarkThemeColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
colorDialogSSAStyle.Color = panelDarkThemeColor.BackColor;
|
||||
if (colorDialogSSAStyle.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
panelDarkThemeColor.BackColor = colorDialogSSAStyle.Color;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonDarkThemeBackColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
colorDialogSSAStyle.Color = panelDarkThemeBackColor.BackColor;
|
||||
if (colorDialogSSAStyle.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
panelDarkThemeBackColor.BackColor = colorDialogSSAStyle.Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user