Linux: Support for GTK dark themes
|
@ -45,7 +45,7 @@ namespace Mesen.GUI.Controls
|
|||
if(!Program.IsMono && Environment.OSVersion.Version >= new Version(6, 2)) {
|
||||
return Properties.Resources.DownArrowWin10;
|
||||
} else {
|
||||
return Properties.Resources.DownArrow;
|
||||
return ThemeHelper.IsDark ? Properties.Resources.DownArrowDarkTheme : Properties.Resources.DownArrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,9 @@ namespace Mesen.GUI.Controls
|
|||
this.MinimumSize = new Size(0, 21);
|
||||
this.Size = new Size(62, 21);
|
||||
|
||||
this.btnDown.Image = ThemeHelper.IsDark ? Properties.Resources.NudDownArrowDarkTheme : Properties.Resources.NudDownArrow;
|
||||
this.btnUp.Image = ThemeHelper.IsDark ? Properties.Resources.NudUpArrowDarkTheme : Properties.Resources.NudUpArrow;
|
||||
|
||||
if(Program.IsMono) {
|
||||
this.BorderStyle = BorderStyle.None;
|
||||
this.txtValue.Dock = DockStyle.Fill;
|
||||
|
@ -221,7 +224,6 @@ namespace Mesen.GUI.Controls
|
|||
//
|
||||
// btnUp
|
||||
//
|
||||
this.btnUp.Image = Properties.Resources.NudUpArrow;
|
||||
this.btnUp.Location = new System.Drawing.Point(1, -1);
|
||||
this.btnUp.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.btnUp.Name = "btnUp";
|
||||
|
@ -235,7 +237,6 @@ namespace Mesen.GUI.Controls
|
|||
//
|
||||
// btnDown
|
||||
//
|
||||
this.btnDown.Image = Properties.Resources.NudDownArrow;
|
||||
this.btnDown.Location = new System.Drawing.Point(1, 9);
|
||||
this.btnDown.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.btnDown.Name = "btnDown";
|
||||
|
|
|
@ -24,6 +24,12 @@ namespace Mesen.GUI.Controls
|
|||
public ctrlNsfPlayer()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(this);
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
if(!IsDesignMode) {
|
||||
this.tmrUpdate.Enabled = true;
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace Mesen.GUI.Controls
|
|||
public ctrlRecentGames()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(this);
|
||||
|
||||
DoubleBuffered = true;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Mesen.GUI.Controls
|
|||
public ctrlRenderer()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(this);
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Mesen.GUI.Controls
|
|||
|
||||
private void chkOption_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.lblNotRecommended.ForeColor = this.chkOption.Checked ? Color.Red : SystemColors.ControlDark;
|
||||
this.lblNotRecommended.ForeColor = this.chkOption.Checked ? ThemeHelper.Theme.ErrorTextColor : ThemeHelper.Theme.GrayTextColor;
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
|
|
|
@ -94,11 +94,11 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
item.SubItems[1].Text = "@ $" + stackInfo.CurrentRelativeAddr.ToString("X4");
|
||||
item.SubItems[2].Text = "[$" + stackInfo.CurrentAbsoluteAddr.ToString("X4") + "]";
|
||||
|
||||
if(!stackInfo.IsMapped && item.ForeColor != Color.Gray) {
|
||||
item.ForeColor = Color.Gray;
|
||||
if(!stackInfo.IsMapped && item.ForeColor != ThemeHelper.Theme.LabelDisabledForeColor) {
|
||||
item.ForeColor = ThemeHelper.Theme.LabelDisabledForeColor;
|
||||
item.Font = new Font(item.Font, FontStyle.Italic);
|
||||
} else if(stackInfo.IsMapped && item.ForeColor != Color.Black) {
|
||||
item.ForeColor = Color.Black;
|
||||
} else if(stackInfo.IsMapped && item.ForeColor != ThemeHelper.Theme.LabelForeColor) {
|
||||
item.ForeColor = ThemeHelper.Theme.LabelForeColor;
|
||||
item.Font = new Font(item.Font, FontStyle.Regular);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,8 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
} else {
|
||||
_txtMappings[i].Text = "";
|
||||
_txtMappings[i].BackColor = Color.White;
|
||||
}
|
||||
}
|
||||
_txtMappings[i].ForeColor = Color.Black;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace Mesen.GUI.Debugger
|
|||
public ctrlConsoleStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.FixMonoColors(contextGoTo);
|
||||
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
|
|
|
@ -245,9 +245,15 @@ namespace Mesen.GUI.Debugger
|
|||
private void ctrlCodeViewer_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(e.Location.X < this.ctrlCodeViewer.CodeMargin / 4) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = contextMenuMargin;
|
||||
if(this.ctrlCodeViewer.ContextMenuStrip != contextMenuMargin) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = contextMenuMargin;
|
||||
ThemeHelper.FixMonoColors(contextMenuMargin);
|
||||
}
|
||||
} else {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = _codeViewerActions.contextMenu;
|
||||
if(this.ctrlCodeViewer.ContextMenuStrip != _codeViewerActions.contextMenu) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = _codeViewerActions.contextMenu;
|
||||
ThemeHelper.FixMonoColors(this.ctrlCodeViewer.ContextMenuStrip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
|
||||
item.SubItems.Add("[n/a]");
|
||||
item.SubItems[1].Tag = -1;
|
||||
item.ForeColor = Color.Gray;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelDisabledForeColor;
|
||||
|
||||
if(italicFont == null) {
|
||||
italicFont = new Font(item.Font, FontStyle.Italic);
|
||||
|
@ -101,14 +101,14 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
if(relativeAddress != (Int32)item.SubItems[1].Tag) {
|
||||
if(relativeAddress >= 0) {
|
||||
item.SubItems[1].Text = "$" + relativeAddress.ToString("X4");
|
||||
item.ForeColor = Color.Black;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelForeColor;
|
||||
if(regularFont == null) {
|
||||
regularFont = new Font(item.Font, FontStyle.Regular);
|
||||
}
|
||||
item.Font = regularFont;
|
||||
} else {
|
||||
item.SubItems[1].Text = "[n/a]";
|
||||
item.ForeColor = Color.Gray;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelDisabledForeColor;
|
||||
if(italicFont == null) {
|
||||
italicFont = new Font(item.Font, FontStyle.Italic);
|
||||
}
|
||||
|
|
|
@ -97,14 +97,14 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
needUpdate = true;
|
||||
if(relativeAddress >= 0) {
|
||||
item.SubItems[1].Text = "$" + relativeAddress.ToString("X4");
|
||||
item.ForeColor = Color.Black;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelForeColor;
|
||||
if(regularFont == null) {
|
||||
regularFont = new Font(item.Font, FontStyle.Regular);
|
||||
}
|
||||
item.Font = regularFont;
|
||||
} else {
|
||||
item.SubItems[1].Text = "[n/a]";
|
||||
item.ForeColor = Color.Gray;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelDisabledForeColor;
|
||||
if(italicFont == null) {
|
||||
italicFont = new Font(item.Font, FontStyle.Italic);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
item.SubItems.Add("$" + relativeAddress.ToString("X4"));
|
||||
} else {
|
||||
item.SubItems.Add("[n/a]");
|
||||
item.ForeColor = Color.Gray;
|
||||
item.ForeColor = ThemeHelper.Theme.LabelDisabledForeColor;
|
||||
if(italicFont == null) {
|
||||
italicFont = new Font(item.Font, FontStyle.Italic);
|
||||
}
|
||||
|
|
|
@ -258,9 +258,15 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
private void ctrlCodeViewer_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(e.Location.X < this.ctrlCodeViewer.CodeMargin / 4) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = contextMenuMargin;
|
||||
if(this.ctrlCodeViewer.ContextMenuStrip != contextMenuMargin) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = contextMenuMargin;
|
||||
ThemeHelper.FixMonoColors(contextMenuMargin);
|
||||
}
|
||||
} else {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = _codeViewerActions.contextMenu;
|
||||
if(this.ctrlCodeViewer.ContextMenuStrip != _codeViewerActions.contextMenu) {
|
||||
this.ctrlCodeViewer.ContextMenuStrip = _codeViewerActions.contextMenu;
|
||||
ThemeHelper.FixMonoColors(this.ctrlCodeViewer.ContextMenuStrip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace Mesen.GUI.Debugger
|
|||
foreach(WatchValueInfo watch in watchContent) {
|
||||
ListViewItem item = new ListViewItem(watch.Expression);
|
||||
item.UseItemStyleForSubItems = false;
|
||||
item.SubItems.Add(watch.Value).ForeColor = watch.HasChanged ? Color.Red : Color.Black;
|
||||
item.SubItems.Add(watch.Value).ForeColor = watch.HasChanged ? ThemeHelper.Theme.ErrorTextColor : ThemeHelper.Theme.LabelForeColor;
|
||||
itemsToAdd.Add(item);
|
||||
}
|
||||
var lastItem = new ListViewItem("");
|
||||
|
@ -89,13 +89,13 @@ namespace Mesen.GUI.Debugger
|
|||
bool needUpdate = (
|
||||
item.SubItems[0].Text != watchContent[i].Expression ||
|
||||
item.SubItems[1].Text != watchContent[i].Value ||
|
||||
item.SubItems[1].ForeColor != (watchContent[i].HasChanged ? Color.Red : Color.Black)
|
||||
item.SubItems[1].ForeColor != (watchContent[i].HasChanged ? ThemeHelper.Theme.ErrorTextColor : ThemeHelper.Theme.LabelForeColor)
|
||||
);
|
||||
if(needUpdate) {
|
||||
updating = true;
|
||||
item.SubItems[0].Text = watchContent[i].Expression;
|
||||
item.SubItems[1].Text = watchContent[i].Value;
|
||||
item.SubItems[1].ForeColor = watchContent[i].HasChanged ? Color.Red : Color.Black;
|
||||
item.SubItems[1].ForeColor = watchContent[i].HasChanged ? ThemeHelper.Theme.ErrorTextColor : ThemeHelper.Theme.LabelForeColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Mesen.GUI.Debugger
|
|||
{
|
||||
base.OnLoad(e);
|
||||
if(!DesignMode) {
|
||||
ThemeHelper.FixMonoColors(this);
|
||||
UpdateLocation();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Mesen.GUI.Debugger
|
|||
public frmAssembler(string code = "", UInt16 startAddress = 0, UInt16 blockLength = 0)
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(txtCode);
|
||||
|
||||
DebugInfo config = ConfigManager.Config.DebugInfo;
|
||||
|
||||
|
|
|
@ -194,10 +194,10 @@ namespace Mesen.GUI.Debugger
|
|||
{
|
||||
int value = -1;
|
||||
if(!int.TryParse(field.Text, NumberStyles.HexNumber, null, out value) || value > maxValue) {
|
||||
field.ForeColor = Color.Red;
|
||||
field.ForeColor = ThemeHelper.Theme.ErrorTextColor;
|
||||
value = -1;
|
||||
} else {
|
||||
field.ForeColor = SystemColors.WindowText;
|
||||
field.ForeColor = ThemeHelper.Theme.TextBoxForeColor;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Mesen.GUI.Debugger
|
|||
public frmScript(bool forceBlank = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(txtScriptContent);
|
||||
|
||||
DebugInfo.ApplyConfig();
|
||||
|
||||
|
|
|
@ -22,16 +22,6 @@ namespace Mesen.GUI.Forms
|
|||
private static Timer _tmrUpdateBackground;
|
||||
private static bool _needResume = false;
|
||||
|
||||
static BaseForm()
|
||||
{
|
||||
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
|
||||
if(!designMode) {
|
||||
_tmrUpdateBackground = new Timer();
|
||||
_tmrUpdateBackground.Start();
|
||||
_tmrUpdateBackground.Tick += tmrUpdateBackground_Tick;
|
||||
}
|
||||
}
|
||||
|
||||
public BaseForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -39,9 +29,16 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
protected virtual bool IsConfigForm { get { return false; } }
|
||||
|
||||
public static void StartBackgroundTimer()
|
||||
{
|
||||
_tmrUpdateBackground = new Timer();
|
||||
_tmrUpdateBackground.Start();
|
||||
_tmrUpdateBackground.Tick += tmrUpdateBackground_Tick;
|
||||
}
|
||||
|
||||
public static void StopBackgroundTimer()
|
||||
{
|
||||
_tmrUpdateBackground.Stop();
|
||||
_tmrUpdateBackground?.Stop();
|
||||
}
|
||||
|
||||
private static void tmrUpdateBackground_Tick(object sender, EventArgs e)
|
||||
|
@ -128,6 +125,7 @@ namespace Mesen.GUI.Forms
|
|||
}
|
||||
|
||||
int tabIndex = 0;
|
||||
ThemeHelper.FixMonoColors(this);
|
||||
InitializeTabIndexes(this, ref tabIndex);
|
||||
ResourceHelper.ApplyResources(this);
|
||||
}
|
||||
|
@ -153,35 +151,6 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
private void InitializeTabIndexes(Control container, ref int tabIndex)
|
||||
{
|
||||
if(Program.IsMono) {
|
||||
if(container is TextBox) {
|
||||
((TextBox)container).BorderStyle = BorderStyle.FixedSingle;
|
||||
((TextBox)container).BackColor = ((TextBox)container).ReadOnly ? Color.FromArgb(240, 240, 240) : Color.FromArgb(255, 255, 255);
|
||||
((TextBox)container).ReadOnlyChanged += (object sender, EventArgs e) => {
|
||||
((TextBox)sender).BackColor = ((TextBox)sender).ReadOnly ? Color.FromArgb(240, 240, 240) : Color.FromArgb(255, 255, 255);
|
||||
};
|
||||
} else if(container is CheckBox) {
|
||||
((CheckBox)container).FlatStyle = FlatStyle.Flat;
|
||||
} else if(container is Button) {
|
||||
((Button)container).FlatStyle = FlatStyle.Flat;
|
||||
((Button)container).BackColor = ((Button)container).Enabled ? Color.FromArgb(230, 230, 230) : Color.FromArgb(180, 180, 180);
|
||||
((Button)container).EnabledChanged += (object sender, EventArgs e) => {
|
||||
((Button)sender).BackColor = ((Button)sender).Enabled ? Color.FromArgb(230, 230, 230) : Color.FromArgb(180, 180, 180);
|
||||
};
|
||||
} else if(container is ComboBox) {
|
||||
((ComboBox)container).FlatStyle = FlatStyle.Flat;
|
||||
((ComboBox)container).BackColor = ((ComboBox)container).Enabled ? Color.FromArgb(230, 230, 230) : Color.FromArgb(180, 180, 180);
|
||||
((ComboBox)container).EnabledChanged += (object sender, EventArgs e) => {
|
||||
((ComboBox)sender).BackColor = ((ComboBox)sender).Enabled ? Color.FromArgb(230, 230, 230) : Color.FromArgb(180, 180, 180);
|
||||
};
|
||||
} else if(container is TabPage) {
|
||||
((TabPage)container).BackColor = Color.White;
|
||||
} else if(container is MenuStrip) {
|
||||
((MenuStrip)container).RenderMode = ToolStripRenderMode.System;
|
||||
} else if(container is ToolStrip) {
|
||||
((ToolStrip)container).RenderMode = ToolStripRenderMode.System;
|
||||
}
|
||||
}
|
||||
container.TabIndex = tabIndex;
|
||||
tabIndex++;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Mesen.GUI.Forms.Config
|
|||
public ctrlKeyBindingHint()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace Mesen.GUI.Forms.Config
|
|||
public frmInputConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(pnlConflictWarning);
|
||||
|
||||
tlpControllers.Enabled = !InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording();
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ namespace Mesen.GUI.Forms.Config
|
|||
{
|
||||
InitializeComponent();
|
||||
|
||||
ThemeHelper.FixMonoColors(contextPaletteList);
|
||||
ThemeHelper.FixMonoColors(contextPicturePresets);
|
||||
|
||||
Entity = ConfigManager.Config.VideoInfo;
|
||||
|
||||
AddBinding("ShowFPS", chkShowFps);
|
||||
|
|
142
GUI.NET/Forms/frmConfigWizard.Designer.cs
generated
|
@ -31,16 +31,20 @@
|
|||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblMiscOptions = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.picLogo = new System.Windows.Forms.PictureBox();
|
||||
this.lblStorageLocation = new System.Windows.Forms.Label();
|
||||
this.lblMesen = new System.Windows.Forms.Label();
|
||||
this.lblConfigWizard = new System.Windows.Forms.Label();
|
||||
this.lblInputMappings = new System.Windows.Forms.Label();
|
||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.chkArrows = new System.Windows.Forms.CheckBox();
|
||||
this.chkWasd = new System.Windows.Forms.CheckBox();
|
||||
this.chkPs4 = new System.Windows.Forms.CheckBox();
|
||||
this.picPs4 = new System.Windows.Forms.PictureBox();
|
||||
this.picXbox = new System.Windows.Forms.PictureBox();
|
||||
this.picWasd = new System.Windows.Forms.PictureBox();
|
||||
this.picArrows = new System.Windows.Forms.PictureBox();
|
||||
this.chkXbox = new System.Windows.Forms.CheckBox();
|
||||
this.lblInputHint = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
|
||||
|
@ -54,14 +58,10 @@
|
|||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblLocation = new System.Windows.Forms.Label();
|
||||
this.lblDataLocation = new System.Windows.Forms.Label();
|
||||
this.chkXbox = new System.Windows.Forms.CheckBox();
|
||||
this.chkPs4 = new System.Windows.Forms.CheckBox();
|
||||
this.chkWasd = new System.Windows.Forms.CheckBox();
|
||||
this.chkArrows = new System.Windows.Forms.CheckBox();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picLogo)).BeginInit();
|
||||
this.tableLayoutPanel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picPs4)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picXbox)).BeginInit();
|
||||
|
@ -85,7 +85,7 @@
|
|||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.Color.White;
|
||||
this.panel2.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.panel2.Controls.Add(this.tableLayoutPanel1);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(3, 3);
|
||||
|
@ -99,7 +99,7 @@
|
|||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblMiscOptions, 0, 10);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.picLogo, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblStorageLocation, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblMesen, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblConfigWizard, 0, 1);
|
||||
|
@ -149,16 +149,16 @@
|
|||
this.lblMiscOptions.TabIndex = 34;
|
||||
this.lblMiscOptions.Text = "Other Options";
|
||||
//
|
||||
// pictureBox1
|
||||
// picLogo
|
||||
//
|
||||
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.pictureBox1.BackgroundImage = global::Mesen.GUI.Properties.Resources.MesenLogo;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(337, 14);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.tableLayoutPanel1.SetRowSpan(this.pictureBox1, 2);
|
||||
this.pictureBox1.Size = new System.Drawing.Size(64, 64);
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.picLogo.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.picLogo.Image = global::Mesen.GUI.Properties.Resources.MesenLogo;
|
||||
this.picLogo.Location = new System.Drawing.Point(337, 14);
|
||||
this.picLogo.Name = "picLogo";
|
||||
this.tableLayoutPanel1.SetRowSpan(this.picLogo, 2);
|
||||
this.picLogo.Size = new System.Drawing.Size(64, 64);
|
||||
this.picLogo.TabIndex = 0;
|
||||
this.picLogo.TabStop = false;
|
||||
//
|
||||
// lblStorageLocation
|
||||
//
|
||||
|
@ -233,6 +233,43 @@
|
|||
this.tableLayoutPanel3.Size = new System.Drawing.Size(388, 90);
|
||||
this.tableLayoutPanel3.TabIndex = 28;
|
||||
//
|
||||
// chkArrows
|
||||
//
|
||||
this.chkArrows.AutoSize = true;
|
||||
this.chkArrows.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkArrows.Checked = true;
|
||||
this.chkArrows.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkArrows.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkArrows.Location = new System.Drawing.Point(294, 73);
|
||||
this.chkArrows.Name = "chkArrows";
|
||||
this.chkArrows.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkArrows.TabIndex = 33;
|
||||
this.chkArrows.UseVisualStyleBackColor = true;
|
||||
this.chkArrows.CheckedChanged += new System.EventHandler(this.chkArrows_CheckedChanged);
|
||||
//
|
||||
// chkWasd
|
||||
//
|
||||
this.chkWasd.AutoSize = true;
|
||||
this.chkWasd.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkWasd.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkWasd.Location = new System.Drawing.Point(197, 73);
|
||||
this.chkWasd.Name = "chkWasd";
|
||||
this.chkWasd.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkWasd.TabIndex = 32;
|
||||
this.chkWasd.UseVisualStyleBackColor = true;
|
||||
this.chkWasd.CheckedChanged += new System.EventHandler(this.chkWasd_CheckedChanged);
|
||||
//
|
||||
// chkPs4
|
||||
//
|
||||
this.chkPs4.AutoSize = true;
|
||||
this.chkPs4.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkPs4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkPs4.Location = new System.Drawing.Point(100, 73);
|
||||
this.chkPs4.Name = "chkPs4";
|
||||
this.chkPs4.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkPs4.TabIndex = 31;
|
||||
this.chkPs4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// picPs4
|
||||
//
|
||||
this.picPs4.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
|
@ -285,6 +322,19 @@
|
|||
this.picArrows.TabStop = false;
|
||||
this.picArrows.Click += new System.EventHandler(this.picArrows_Click);
|
||||
//
|
||||
// chkXbox
|
||||
//
|
||||
this.chkXbox.AutoSize = true;
|
||||
this.chkXbox.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkXbox.Checked = true;
|
||||
this.chkXbox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkXbox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkXbox.Location = new System.Drawing.Point(3, 73);
|
||||
this.chkXbox.Name = "chkXbox";
|
||||
this.chkXbox.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkXbox.TabIndex = 30;
|
||||
this.chkXbox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblInputHint
|
||||
//
|
||||
this.lblInputHint.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
|
@ -393,8 +443,9 @@
|
|||
// chkCreateShortcut
|
||||
//
|
||||
this.chkCreateShortcut.AutoSize = true;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.chkCreateShortcut, 2);
|
||||
this.chkCreateShortcut.Checked = true;
|
||||
this.chkCreateShortcut.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.chkCreateShortcut, 2);
|
||||
this.chkCreateShortcut.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.chkCreateShortcut.Location = new System.Drawing.Point(21, 415);
|
||||
this.chkCreateShortcut.Margin = new System.Windows.Forms.Padding(11, 6, 3, 3);
|
||||
|
@ -454,60 +505,11 @@
|
|||
this.lblDataLocation.TabIndex = 0;
|
||||
this.lblDataLocation.Text = "Folder:";
|
||||
//
|
||||
// chkXbox
|
||||
//
|
||||
this.chkXbox.AutoSize = true;
|
||||
this.chkXbox.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkXbox.Checked = true;
|
||||
this.chkXbox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkXbox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkXbox.Location = new System.Drawing.Point(3, 73);
|
||||
this.chkXbox.Name = "chkXbox";
|
||||
this.chkXbox.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkXbox.TabIndex = 30;
|
||||
this.chkXbox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkPs4
|
||||
//
|
||||
this.chkPs4.AutoSize = true;
|
||||
this.chkPs4.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkPs4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkPs4.Location = new System.Drawing.Point(100, 73);
|
||||
this.chkPs4.Name = "chkPs4";
|
||||
this.chkPs4.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkPs4.TabIndex = 31;
|
||||
this.chkPs4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkWasd
|
||||
//
|
||||
this.chkWasd.AutoSize = true;
|
||||
this.chkWasd.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkWasd.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkWasd.Location = new System.Drawing.Point(197, 73);
|
||||
this.chkWasd.Name = "chkWasd";
|
||||
this.chkWasd.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkWasd.TabIndex = 32;
|
||||
this.chkWasd.UseVisualStyleBackColor = true;
|
||||
this.chkWasd.CheckedChanged += new System.EventHandler(this.chkWasd_CheckedChanged);
|
||||
//
|
||||
// chkArrows
|
||||
//
|
||||
this.chkArrows.AutoSize = true;
|
||||
this.chkArrows.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.chkArrows.Checked = true;
|
||||
this.chkArrows.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkArrows.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chkArrows.Location = new System.Drawing.Point(294, 73);
|
||||
this.chkArrows.Name = "chkArrows";
|
||||
this.chkArrows.Size = new System.Drawing.Size(91, 14);
|
||||
this.chkArrows.TabIndex = 33;
|
||||
this.chkArrows.UseVisualStyleBackColor = true;
|
||||
this.chkArrows.CheckedChanged += new System.EventHandler(this.chkArrows_CheckedChanged);
|
||||
//
|
||||
// frmConfigWizard
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ClientSize = new System.Drawing.Size(420, 484);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
|
@ -518,7 +520,7 @@
|
|||
this.panel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picLogo)).EndInit();
|
||||
this.tableLayoutPanel3.ResumeLayout(false);
|
||||
this.tableLayoutPanel3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picPs4)).EndInit();
|
||||
|
@ -539,7 +541,7 @@
|
|||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.PictureBox picLogo;
|
||||
private System.Windows.Forms.Label lblMesen;
|
||||
private System.Windows.Forms.Label lblConfigWizard;
|
||||
private System.Windows.Forms.Label lblStorageLocation;
|
||||
|
|
|
@ -20,12 +20,20 @@ namespace Mesen.GUI.Forms
|
|||
{
|
||||
public frmConfigWizard()
|
||||
{
|
||||
ThemeHelper.InitTheme(this.BackColor);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this.Icon = Properties.Resources.MesenIcon;
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
ThemeHelper.FixMonoColors(this);
|
||||
lblLocation.Text = ConfigManager.DefaultDocumentsFolder;
|
||||
lblLocation.ForeColor = Color.FromArgb(61,125,255);
|
||||
lblCancel.ForeColor = Color.FromArgb(61, 125, 255);
|
||||
lblLocation.ForeColor = ThemeHelper.Theme.LinkTextColor;
|
||||
lblCancel.ForeColor = ThemeHelper.Theme.LinkTextColor;
|
||||
}
|
||||
|
||||
private void InitializeConfig()
|
||||
|
|
|
@ -117,7 +117,4 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -18,6 +18,7 @@ namespace Mesen.GUI.Forms
|
|||
public frmHelp()
|
||||
{
|
||||
InitializeComponent();
|
||||
ThemeHelper.ExcludeFromTheme(lblExample);
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
|
|
|
@ -72,8 +72,12 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
public frmMain(string[] args)
|
||||
{
|
||||
ThemeHelper.InitTheme(this.BackColor);
|
||||
InitializeComponent();
|
||||
|
||||
ThemeHelper.ExcludeFromTheme(panelInfo);
|
||||
ThemeHelper.ExcludeFromTheme(panelRenderer);
|
||||
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
|
||||
Version currentVersion = new Version(InteropEmu.GetMesenVersion());
|
||||
|
@ -251,6 +255,8 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
mnuDebugDualSystemSecondaryCpu.Checked = ConfigManager.Config.DebugInfo.DebugConsoleId == InteropEmu.ConsoleId.Slave;
|
||||
InteropEmu.DebugSetDebuggerConsole(ConfigManager.Config.DebugInfo.DebugConsoleId);
|
||||
|
||||
BaseForm.StartBackgroundTimer();
|
||||
}
|
||||
|
||||
private void ProcessFullscreenSwitch(List<string> switches)
|
||||
|
|
|
@ -1254,12 +1254,16 @@
|
|||
<Compile Include="GoogleDriveIntegration\GoogleDriveAccessor.cs" />
|
||||
<Compile Include="GoogleDriveIntegration\MesenCodeReceiver.cs" />
|
||||
<Compile Include="InteropEmu.cs" />
|
||||
<Compile Include="ThemeHelper.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ResourceManager.cs" />
|
||||
<Compile Include="RuntimeChecker.cs" />
|
||||
<Compile Include="SingleInstance.cs" />
|
||||
<Compile Include="TestRunner.cs" />
|
||||
<None Include="Resources\NudDownArrowDarkTheme.png" />
|
||||
<None Include="Resources\DownArrowDarkTheme.png" />
|
||||
<None Include="Resources\NudUpArrowDarkTheme.png" />
|
||||
<None Include="Resources\PerfTracker.png" />
|
||||
<None Include="Resources\Zoom2x.png" />
|
||||
<None Include="Resources\Expand.png" />
|
||||
|
|
30
GUI.NET/Properties/Resources.Designer.cs
generated
|
@ -310,6 +310,16 @@ namespace Mesen.GUI.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap DownArrowDarkTheme {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("DownArrowDarkTheme", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -660,6 +670,16 @@ namespace Mesen.GUI.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap NudDownArrowDarkTheme {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("NudDownArrowDarkTheme", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -670,6 +690,16 @@ namespace Mesen.GUI.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap NudUpArrowDarkTheme {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("NudUpArrowDarkTheme", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
|
|
@ -445,4 +445,13 @@
|
|||
<data name="PerfTracker" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\PerfTracker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="DownArrowDarkTheme" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\DownArrowDarkTheme.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="NudDownArrowDarkTheme" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\NudDownArrowDarkTheme.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="NudUpArrowDarkTheme" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\NudUpArrowDarkTheme.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 241 B |
BIN
GUI.NET/Resources/DownArrowDarkTheme.png
Normal file
After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 228 B |
BIN
GUI.NET/Resources/NudDownArrowDarkTheme.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
GUI.NET/Resources/NudUpArrowDarkTheme.png
Normal file
After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.3 KiB |
270
GUI.NET/ThemeHelper.cs
Normal file
|
@ -0,0 +1,270 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Mesen.GUI
|
||||
{
|
||||
public static class ThemeHelper
|
||||
{
|
||||
public static MonoTheme Theme { get; private set; } = new MonoTheme();
|
||||
public static Dictionary<string, List<WeakReference<object>>> _excludedControls = new Dictionary<string, List<WeakReference<object>>>();
|
||||
|
||||
public static void InitTheme(Color backColor)
|
||||
{
|
||||
if(backColor.R < 128 && backColor.G < 128 && backColor.B < 128) {
|
||||
Theme = new DarkMonoTheme();
|
||||
} else {
|
||||
Theme = new MonoTheme();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsDark { get { return Theme is DarkMonoTheme; } }
|
||||
|
||||
public static void ExcludeFromTheme(Control ctrl)
|
||||
{
|
||||
if(Program.IsMono) {
|
||||
List<WeakReference<object>> refList;
|
||||
if(!_excludedControls.TryGetValue(ctrl.Name, out refList)) {
|
||||
refList = new List<WeakReference<object>>();
|
||||
_excludedControls[ctrl.Name] = refList;
|
||||
}
|
||||
refList.Add(new WeakReference<object>(ctrl));
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsExcludedFromTheme(Control ctrl)
|
||||
{
|
||||
if(Program.IsMono) {
|
||||
List<WeakReference<object>> refList;
|
||||
if(_excludedControls.TryGetValue(ctrl.Name, out refList)) {
|
||||
foreach(WeakReference<object> weakRef in refList) {
|
||||
object target;
|
||||
if(weakRef.TryGetTarget(out target)) {
|
||||
return target == ctrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void FixMonoColors(Form form)
|
||||
{
|
||||
if(Program.IsMono) {
|
||||
form.BackColor = Theme.FormBgColor;
|
||||
FixMonoColors(form, Theme);
|
||||
}
|
||||
}
|
||||
|
||||
public static void FixMonoColors(Control ctrl)
|
||||
{
|
||||
if(Program.IsMono) {
|
||||
FixMonoColors(ctrl, Theme);
|
||||
}
|
||||
}
|
||||
|
||||
private static void FixMonoColors(ToolStripItem item, MonoTheme theme)
|
||||
{
|
||||
item.ForeColor = item.Enabled ? theme.ToolStripItemForeColor : theme.ToolStripItemDisabledForeColor;
|
||||
item.BackColor = theme.ToolStripItemBgColor;
|
||||
item.EnabledChanged += (object sender, EventArgs e) => {
|
||||
((ToolStripItem)sender).ForeColor = ((ToolStripItem)sender).Enabled ? theme.ToolStripItemForeColor : theme.ToolStripItemDisabledForeColor;
|
||||
};
|
||||
|
||||
if(item is ToolStripDropDownItem) {
|
||||
((ToolStripDropDownItem)item).DropDownOpening += (object sender, EventArgs e) => {
|
||||
((ToolStripDropDownItem)item).DropDown.BackColor = theme.ToolStripItemBgColor;
|
||||
foreach(ToolStripItem subItem in ((ToolStripDropDownItem)item).DropDownItems) {
|
||||
FixMonoColors(subItem, theme);
|
||||
}
|
||||
};
|
||||
|
||||
foreach(ToolStripItem subItem in ((ToolStripDropDownItem)item).DropDownItems) {
|
||||
FixMonoColors(subItem, theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void FixMonoColors(Control container, MonoTheme theme)
|
||||
{
|
||||
if(ThemeHelper.IsExcludedFromTheme(container)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(container is TextBox) {
|
||||
TextBox txt = (TextBox)container;
|
||||
txt.BorderStyle = BorderStyle.FixedSingle;
|
||||
txt.BackColor = txt.ReadOnly ? theme.TextBoxDisabledBgColor : theme.TextBoxEnabledBgColor;
|
||||
txt.ForeColor = theme.TextBoxForeColor;
|
||||
txt.ReadOnlyChanged += (object sender, EventArgs e) => {
|
||||
((TextBox)sender).BackColor = ((TextBox)sender).ReadOnly ? theme.TextBoxDisabledBgColor : theme.TextBoxEnabledBgColor;
|
||||
};
|
||||
} else if(container is Label) {
|
||||
Label lbl = (Label)container;
|
||||
if(lbl.BackColor == Color.White) {
|
||||
//Trackbar labels
|
||||
lbl.BackColor = theme.TextBoxEnabledBgColor;
|
||||
lbl.ForeColor = theme.TextBoxForeColor;
|
||||
} else {
|
||||
if(lbl.ForeColor == SystemColors.GrayText) {
|
||||
//Headers
|
||||
lbl.ForeColor = theme.GrayTextColor;
|
||||
} else if(lbl.ForeColor == SystemColors.ControlDark) {
|
||||
//ctrlRiskyOption
|
||||
lbl.ForeColor = theme.DarkTextColor;
|
||||
} else {
|
||||
//Regular label
|
||||
lbl.ForeColor = lbl.Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
lbl.EnabledChanged += (object sender, EventArgs e) => {
|
||||
((Label)sender).ForeColor = ((Label)sender).Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
};
|
||||
}
|
||||
}
|
||||
} else if(container is CheckBox) {
|
||||
CheckBox chk = (CheckBox)container;
|
||||
chk.FlatStyle = FlatStyle.Flat;
|
||||
chk.ForeColor = chk.Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
if(chk.BackColor == SystemColors.ControlLightLight) {
|
||||
//Enable equalizer checkbox
|
||||
chk.BackColor = theme.TabBgColor;
|
||||
}
|
||||
chk.EnabledChanged += (object sender, EventArgs e) => {
|
||||
((CheckBox)sender).ForeColor = ((CheckBox)sender).Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
};
|
||||
} else if(container is RadioButton) {
|
||||
((RadioButton)container).ForeColor = ((RadioButton)container).Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
((RadioButton)container).EnabledChanged += (object sender, EventArgs e) => {
|
||||
((RadioButton)sender).ForeColor = ((RadioButton)sender).Enabled ? theme.LabelForeColor : theme.LabelDisabledForeColor;
|
||||
};
|
||||
} else if(container is TrackBar) {
|
||||
((TrackBar)container).BackColor = theme.TabBgColor;
|
||||
} else if(container is Button) {
|
||||
Button btn = (Button)container;
|
||||
btn.FlatStyle = FlatStyle.Flat;
|
||||
btn.BackColor = btn.Enabled ? theme.ButtonEnabledBgColor : theme.ButtonDisabledBgColor;
|
||||
btn.ForeColor = theme.ButtonForeColor;
|
||||
|
||||
btn.EnabledChanged += (object sender, EventArgs e) => {
|
||||
((Button)sender).BackColor = ((Button)sender).Enabled ? theme.ButtonEnabledBgColor : theme.ButtonDisabledBgColor;
|
||||
};
|
||||
} else if(container is ComboBox) {
|
||||
ComboBox cbo = (ComboBox)container;
|
||||
cbo.FlatStyle = FlatStyle.Flat;
|
||||
cbo.BackColor = cbo.Enabled ? theme.ComboEnabledBgColor : theme.ComboDisabledBgColor;
|
||||
cbo.ForeColor = theme.TextBoxForeColor;
|
||||
cbo.EnabledChanged += (object sender, EventArgs e) => {
|
||||
((ComboBox)sender).BackColor = ((ComboBox)sender).Enabled ? theme.ComboEnabledBgColor : theme.ComboDisabledBgColor;
|
||||
};
|
||||
} else if(container is GroupBox) {
|
||||
((GroupBox)container).ForeColor = theme.LabelForeColor;
|
||||
} else if(container is TabControl) {
|
||||
((TabControl)container).BackColor = theme.TabBgColor;
|
||||
} else if(container is TabPage) {
|
||||
((TabPage)container).BackColor = theme.TabBgColor;
|
||||
} else if(container is Panel && !(container is TableLayoutPanel) && !(container is FlowLayoutPanel)) {
|
||||
((Panel)container).BackColor = theme.PanelBgColor;
|
||||
} else if(container is DataGridView) {
|
||||
DataGridView dgv = (DataGridView)container;
|
||||
dgv.BackgroundColor = theme.ListBgColor;
|
||||
dgv.ForeColor = theme.LabelForeColor;
|
||||
dgv.GridColor = theme.LabelForeColor;
|
||||
dgv.DefaultCellStyle.ForeColor = theme.LabelForeColor;
|
||||
dgv.DefaultCellStyle.BackColor = theme.ListBgColor;
|
||||
dgv.ColumnHeadersDefaultCellStyle.ForeColor = theme.LabelForeColor;
|
||||
dgv.ColumnHeadersDefaultCellStyle.BackColor = theme.TabBgColor;
|
||||
} else if(container is DataGridTextBox) {
|
||||
((DataGridTextBox)container).BackColor = theme.TextBoxEnabledBgColor;
|
||||
((DataGridTextBox)container).ForeColor = theme.TextBoxForeColor;
|
||||
} else if(container is ListView) {
|
||||
((ListView)container).BackColor = theme.ListBgColor;
|
||||
((ListView)container).ForeColor = theme.LabelForeColor;
|
||||
} else if(container is ToolStrip) {
|
||||
((ToolStrip)container).BackColor = theme.FormBgColor;
|
||||
((ToolStrip)container).RenderMode = ToolStripRenderMode.System;
|
||||
foreach(ToolStripItem item in ((ToolStrip)container).Items) {
|
||||
FixMonoColors(item, theme);
|
||||
}
|
||||
}
|
||||
|
||||
if(container.ContextMenuStrip != null) {
|
||||
container.ContextMenuStrip.RenderMode = ToolStripRenderMode.System;
|
||||
foreach(ToolStripItem item in container.ContextMenuStrip.Items) {
|
||||
FixMonoColors(item, theme);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Control ctrl in container.Controls) {
|
||||
FixMonoColors(ctrl, theme);
|
||||
}
|
||||
}
|
||||
|
||||
public class MonoTheme
|
||||
{
|
||||
public virtual Color TextBoxDisabledBgColor { get; } = Color.FromArgb(240, 240, 240);
|
||||
public virtual Color TextBoxEnabledBgColor { get; } = Color.FromArgb(255, 255, 255);
|
||||
public virtual Color TextBoxForeColor { get; } = Color.FromArgb(0, 0, 0);
|
||||
|
||||
public virtual Color ButtonDisabledBgColor { get; } = Color.FromArgb(180, 180, 180);
|
||||
public virtual Color ButtonEnabledBgColor { get; } = Color.FromArgb(230, 230, 230);
|
||||
public virtual Color ButtonForeColor { get; } = Color.FromArgb(0, 0, 0);
|
||||
|
||||
public virtual Color LabelForeColor { get; } = Program.IsMono ? Color.Black : SystemColors.ControlText;
|
||||
public virtual Color LabelDisabledForeColor { get; } = Color.Gray;
|
||||
public virtual Color ErrorTextColor { get; } = Color.Red;
|
||||
public virtual Color GrayTextColor { get; } = Program.IsMono ? Color.Gray : SystemColors.GrayText;
|
||||
public virtual Color DarkTextColor { get; } = Program.IsMono ? Color.LightGray : SystemColors.ControlDark;
|
||||
public virtual Color LinkTextColor { get; } = Color.FromArgb(61, 125, 255);
|
||||
|
||||
public virtual Color ComboEnabledBgColor { get; } = Color.FromArgb(230, 230, 230);
|
||||
public virtual Color ComboDisabledBgColor { get; } = Color.FromArgb(180, 180, 180);
|
||||
|
||||
public virtual Color FormBgColor { get; } = Program.IsMono ? Color.FromArgb(239, 240, 241) : SystemColors.Control;
|
||||
public virtual Color TabBgColor { get; } = Program.IsMono ? Color.White : Color.Transparent;
|
||||
public virtual Color PanelBgColor { get; } = Program.IsMono ? Color.FromArgb(239, 240, 241) : SystemColors.Control;
|
||||
public virtual Color ListBgColor { get; } = Program.IsMono ? Color.White : SystemColors.ControlLightLight;
|
||||
|
||||
public virtual Color ToolStripItemBgColor { get; } = Program.IsMono ? Color.FromArgb(239, 240, 241) : SystemColors.Control;
|
||||
public virtual Color ToolStripItemForeColor { get; } = Color.Black;
|
||||
public virtual Color ToolStripItemDisabledForeColor { get; } = Color.Gray;
|
||||
}
|
||||
|
||||
class DarkMonoTheme : MonoTheme
|
||||
{
|
||||
private static readonly Color TextColor = Color.FromArgb(255, 255, 255);
|
||||
private static readonly Color MainBgColor = Color.FromArgb(49, 54, 69);
|
||||
private static readonly Color HighlightBgColor = Color.FromArgb(69, 73, 70);
|
||||
private static readonly Color HighlightDisabledBgColor = Color.FromArgb(47, 52, 57);
|
||||
|
||||
public override Color TextBoxDisabledBgColor { get; } = DarkMonoTheme.HighlightDisabledBgColor;
|
||||
public override Color TextBoxEnabledBgColor { get; } = Color.FromArgb(69, 73, 78);
|
||||
public override Color TextBoxForeColor { get; } = DarkMonoTheme.TextColor;
|
||||
|
||||
public override Color ButtonDisabledBgColor { get; } = DarkMonoTheme.HighlightDisabledBgColor;
|
||||
public override Color ButtonEnabledBgColor { get; } = DarkMonoTheme.HighlightBgColor;
|
||||
public override Color ButtonForeColor { get; } = DarkMonoTheme.TextColor;
|
||||
|
||||
public override Color LabelForeColor { get; } = DarkMonoTheme.TextColor;
|
||||
public override Color LabelDisabledForeColor { get; } = Color.Gray;
|
||||
public override Color ErrorTextColor { get; } = Color.IndianRed;
|
||||
public override Color GrayTextColor { get; } = Color.LightGray;
|
||||
public override Color DarkTextColor { get; } = Color.LightGray;
|
||||
public override Color LinkTextColor { get; } = Color.FromArgb(61, 125, 255);
|
||||
|
||||
public override Color ComboEnabledBgColor { get; } = Color.FromArgb(69, 73, 78);
|
||||
public override Color ComboDisabledBgColor { get; } = Color.FromArgb(47, 52, 47);
|
||||
|
||||
public override Color FormBgColor { get; } = DarkMonoTheme.MainBgColor;
|
||||
public override Color TabBgColor { get; } = Color.FromArgb(45, 49, 54);
|
||||
public override Color PanelBgColor { get; } = DarkMonoTheme.MainBgColor;
|
||||
public override Color ListBgColor { get; } = Color.FromArgb(45, 49, 54);
|
||||
|
||||
public override Color ToolStripItemBgColor { get; } = DarkMonoTheme.MainBgColor;
|
||||
public override Color ToolStripItemForeColor { get; } = DarkMonoTheme.TextColor;
|
||||
public override Color ToolStripItemDisabledForeColor { get; } = Color.Gray;
|
||||
}
|
||||
}
|
||||
}
|