示例#1
0
        private void trOpacity_Scroll(object sender, EventArgs e)
        {
            var opacity = trOpacity.Value;

            ThemeUtil.SetOpacity(opacity);
            Settings.Theme.Opacity = opacity;
        }
示例#2
0
        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;
        }
示例#3
0
        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;
        }
示例#4
0
        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);
        }
示例#5
0
 public ThemeForm()
 {
     InitializeComponent();
     ThemeUtil.Apply(this);
 }
示例#6
0
 public ThemeForm()
 {
     componentsLayout();
     ThemeUtil.Apply(this);
 }