private void panel_theme_Click(object sender, EventArgs e) { ThemeStandard.Settings.CI ci = (ThemeStandard.Settings.CI)(((Control)sender).Tag); // tag carries the colour we want to edit if (EditColor(ci)) { ApplyChanges?.Invoke(); UpdatePatchesEtc(); } }
public bool EditColor(ThemeStandard.Settings.CI ex) { ColorDialog MyDialog = new ColorDialog(); MyDialog.AllowFullOpen = true; MyDialog.FullOpen = true; MyDialog.Color = theme.currentsettings.colors[ex]; if (MyDialog.ShowDialog(this) == DialogResult.OK) { theme.currentsettings.colors[ex] = MyDialog.Color; theme.SetCustom(); return(true); } else { return(false); } }
private void SetPanel(Panel pn, string name, ThemeStandard.Settings.CI ex) { toolTip1.SetToolTip(pn, name); // assign tool tips and indicate which color to edit pn.Tag = ex; pn.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_theme_Click); }
private void UpdatePatch(Panel pn) { ThemeStandard.Settings.CI ci = (ThemeStandard.Settings.CI)(pn.Tag); pn.BackColor = theme.currentsettings.colors[ci]; }