/// <summary> /// News the color scheme. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="FormClosedEventArgs"/> instance containing the event data.</param> private void newColorScheme(object sender, FormClosedEventArgs e) { flowLayoutPanel1.Controls.Clear(); foreach (ColorSchemePreset objPrest in SkinManager.ColorSchemes.List()) { ThemePreview objPreview = new ThemePreview(objPrest); objPreview.Click += objPreview_Click; flowLayoutPanel1.Controls.Add(objPreview); } }
/// <summary> /// Handles the Click event of the objPreview control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> void objPreview_Click(object sender, EventArgs e) { ThemePreview objPreview = (ThemePreview)sender; Point OverlayOrigin = new Point(); OverlayOrigin = Cursor.Position; ColorOverlay objOverlay = new ColorOverlay(OverlayOrigin, objPreview.getColorSchemePreset(), _BaseForm, _Parent); objOverlay.FormClosed += objOverlay_FormClosed; objOverlay.Show(); }
/// <summary> /// Initializes a new instance of the <see cref="MaterialThemeSettings"/> class. /// </summary> /// <param name="pBaseForm">The p base form.</param> /// <param name="pSettings">The p settings.</param> public MaterialThemeSettings(MaterialForm pBaseForm, MaterialSettings pSettings) { InitializeComponent(); _Parent = pSettings; _BaseForm = pBaseForm; tgl_Theme.Checked = SkinManager.Theme == MaterialSkinManager.Themes.DARK; Ignore = tgl_Theme.Checked; foreach (ColorSchemePreset objPrest in SkinManager.ColorSchemes.List()) { ThemePreview objPreview = new ThemePreview(objPrest); objPreview.Click += objPreview_Click; flowLayoutPanel1.Controls.Add(objPreview); } Bitmap bmp = new Bitmap(materialFloatingActionButton1.Width, materialFloatingActionButton1.Height); Graphics g = Graphics.FromImage(bmp); Pen p = new Pen(Brushes.White, 6); g.DrawLine(p, new Point(0, bmp.Height / 2), new Point(bmp.Width, bmp.Height / 2)); g.DrawLine(p, new Point(bmp.Width / 2, 0), new Point(bmp.Width / 2, bmp.Height)); materialFloatingActionButton1.Icon = bmp; }