public SettingAppearance() { InitializeComponent(); var colorList = new[] { Color.FromArgb(164, 196, 0), Color.FromArgb(96, 169, 23), Color.FromArgb(0, 138, 0), Color.FromArgb(0, 171, 169), Color.FromArgb(27, 161, 226), Color.FromArgb(0, 80, 239), Color.FromArgb(106, 0, 255), Color.FromArgb(170, 0, 255), Color.FromArgb(244, 114, 208), Color.FromArgb(216, 0, 115), Color.FromArgb(162, 0, 37), Color.FromArgb(229, 20, 0), Color.FromArgb(250, 104, 0), Color.FromArgb(240, 163, 10), Color.FromArgb(227, 200, 0), Color.FromArgb(130, 90, 44), Color.FromArgb(109, 135, 100), Color.FromArgb(100, 118, 135), Color.FromArgb(118, 96, 138), Color.FromArgb(135, 121, 78) }; // AccentColors picker int x = 0; int y = 0; foreach (var accentColor in colorList) { var newColorPicker = new YamuiColorRadioButton(); _simplePanelAccentColor.Controls.Add(newColorPicker); newColorPicker.CheckedChanged += NewColorPickerOnCheckedChanged; newColorPicker.BackColor = accentColor; newColorPicker.Bounds = new Rectangle(x, y, 50, 50); if (y + 2*newColorPicker.Height > _simplePanelAccentColor.Height) { x += newColorPicker.Width; y = 0; } else y += newColorPicker.Height; if (YamuiThemeManager.Current.AccentColor == accentColor) { _checkButton = newColorPicker; newColorPicker.Checked = true; } } // themes comob box comboTheme.DataSource = YamuiThemeManager.GetThemesList().Select(theme => theme.ThemeName).ToList(); comboTheme.SelectedIndex = YamuiThemeManager.GetThemesList().IndexOf(YamuiThemeManager.Current); comboTheme.SelectedIndexChanged += ComboThemeOnSelectedIndexChanged; }
public SettingAppearance() { InitializeComponent(); // AccentColors picker int x = 0; int y = 0; foreach (var accentColor in ThemeManager.GetAccentColors) { var newColorPicker = new YamuiColorRadioButton(); _simplePanelAccentColor.Controls.Add(newColorPicker); newColorPicker.CheckedChanged += NewColorPickerOnCheckedChanged; newColorPicker.BackColor = accentColor; newColorPicker.Location = new Point(x, y); newColorPicker.Size = new Size(50, 50); //newColorPicker.Bounds = new Rectangle(x, y, 50, 50); if (y + 2*newColorPicker.Height > _simplePanelAccentColor.Height) { x += newColorPicker.Width; y = 0; } else y += newColorPicker.Height; if (ThemeManager.Current.AccentColor == accentColor) { _checkButton = newColorPicker; newColorPicker.Checked = true; } toolTip.SetToolTip(newColorPicker, "Click me to set a new accent color for the current theme"); } // toggle tg_colorOn.ButtonPressed += TgOnCheckedChanged; tg_colorOn.Checked = Config.Instance.UseSyntaxHighlightTheme; UpdateToggle(); // tooltips toolTip.SetToolTip(cbApplication, "Choose the theme you wish to use for the software"); toolTip.SetToolTip(cbSyntax, "Choose the theme you wish to use for the syntax highlighting"); toolTip.SetToolTip(tg_colorOn, "Toggle this option OFF if you are using your own User Defined Language<br><br>By default, 3P created a new UDL called 'OpenEdgeABL' and applies the selected theme below<br>each time the user switches the current document<br>By toggling this OFF, you will prevent this behavior and you can define your own UDL<br><br><i>If you toggle this OFF, select the UDL to use from the Language menu before you can see any changes</i>"); linkurl.Text = @"<img src='Help'><a href='" + Config.UrlHelpCustomThemes + @"'>How to customize the look of 3P?</a>"; // dynamically reorder the controls for a correct tab order on notepad++ SetTabOrder.RemoveAndAddForTabOrder(scrollPanel); }
/// <summary> /// Changing accent Color /// </summary> private void NewColorPickerOnCheckedChanged(object sender, EventArgs eventArgs) { YamuiColorRadioButton rb = sender as YamuiColorRadioButton; if (rb != null && rb.Checked) { ThemeManager.Current.AccentColor = rb.BackColor; ThemeManager.RefreshApplicationWithTheme(ThemeManager.Current); _checkButton = rb; } }
/// <summary> /// Changing accent Color /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void NewColorPickerOnCheckedChanged(object sender, EventArgs eventArgs) { YamuiColorRadioButton rb = sender as YamuiColorRadioButton; if (rb != null && rb.Checked) { YamuiThemeManager.Current.AccentColor = rb.BackColor; _checkButton = rb; if (Program.MainForm != null) PlsRefresh(); } }