private void trOpacity_Scroll(object sender, EventArgs e) { var opacity = trOpacity.Value; ThemeUtil.SetOpacity(opacity); Settings.Theme.Opacity = opacity; }
private static void UpdateTheme(Button src, ThemeType type) { var theme = new ThemeDescription { ForeColor = src.ForeColor, BackColor = src.BackColor }; ThemeUtil.SetTheme(theme); Settings.Theme.Type = type; }
private void linkBg_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var dialog = new ColorDialog(); if (dialog.ShowDialog(this) != DialogResult.OK) { return; } var color = dialog.Color; lbBg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B); ThemeUtil.Get(ThemeType.Custom).BackColor = Settings.Theme.CustomBackColor = btnThemeCustom.BackColor = color; }
private void ThemeForm_Load(object sender, EventArgs e) { trOpacity.Value = Settings.Theme.Opacity; // 加载自定义颜色 var theme = ThemeUtil.Get(ThemeType.Custom); if (theme.IsEmpty) { return; } btnThemeCustom.ForeColor = theme.ForeColor; btnThemeCustom.BackColor = theme.BackColor; lbFg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", theme.ForeColor.R, theme.ForeColor.G, theme.ForeColor.B); lbBg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", theme.BackColor.R, theme.BackColor.G, theme.BackColor.B); }
public ThemeForm() { InitializeComponent(); ThemeUtil.Apply(this); }
public ThemeForm() { componentsLayout(); ThemeUtil.Apply(this); }