private void LoadColorTheme(ColorTheme t) { lvwResults.BackColor = t.GetColor("find-results-panel/background"); lvwResults.ForeColor = t.GetColor("find-results-panel/foreground"); lvwResults.OwnerDraw = t.GetBool("find-results-panel/owner-draw"); lvwResults.GridLines = t.GetBool("find-results-panel/grid-lines"); lvwResults.Layout += (s, a) => { lvwResults.Columns[lvwResults.Columns.Count - 1].Width = t.GetInt("find-results-panel/last-column-width"); }; lvwResults.DrawItem += (s, a) => a.DrawDefault = t.GetBool("find-results-panel/draw-item"); lvwResults.DrawSubItem += (s, a) => a.DrawDefault = t.GetBool("find-results-panel/draw-sub-item"); lvwResults.DrawColumnHeader += (s, a) => { a.Graphics.FillRectangle(new SolidBrush(t.GetColor("find-results-panel/column-header/background")), a.Bounds); a.Graphics.DrawString(a.Header.Text, lvwResults.Font, new SolidBrush(t.GetColor("find-results-panel/column-header/foreground")), a.Bounds.X + 5, a.Bounds.Y + a.Bounds.Size.Height / 5); a.Graphics.DrawRectangle(new Pen(new SolidBrush(t.GetColor("find-results-panel/column-header/border"))), a.Bounds.X - 1, a.Bounds.Y - 1, a.Bounds.Size.Width, a.Bounds.Size.Height); }; }
private void LoadColorTheme(ColorTheme t) { BackColor = t.GetColor("global-variables-editor/background"); ForeColor = t.GetColor("global-variables-editor/foreground"); mainFrame.BackColor = t.GetColor("global-variables-editor/box/background"); mainFrame.ForeColor = t.GetColor("global-variables-editor/box/foreground"); lvwWords.BackColor = t.GetColor("global-variables-editor/list/background"); lvwWords.ForeColor = t.GetColor("global-variables-editor/list/foreground"); lvwWords.OwnerDraw = t.GetBool("global-variables-editor/list/owner-draw"); lvwWords.GridLines = t.GetBool("global-variables-editor/list/grid-lines"); lvwWords.Layout += (s, a) => { lvwWords.Columns[lvwWords.Columns.Count - 1].Width = t.GetInt("global-variables-editor/list/last-column-width"); }; lvwWords.DrawItem += (s, a) => a.DrawDefault = t.GetBool("global-variables-editor/list/draw-item"); lvwWords.DrawSubItem += (s, a) => a.DrawDefault = t.GetBool("global-variables-editor/list/draw-sub-item"); lvwWords.DrawColumnHeader += (s, a) => { a.Graphics.FillRectangle(new SolidBrush(t.GetColor("global-variables-editor/list/column-header/background")), a.Bounds); a.Graphics.DrawString(a.Header.Text, lvwWords.Font, new SolidBrush(t.GetColor("global-variables-editor/list/column-header/foreground")), a.Bounds.X + 5, a.Bounds.Y + a.Bounds.Size.Height / 5); a.Graphics.DrawRectangle(new Pen(new SolidBrush(t.GetColor("global-variables-editor/list/column-header/border"))), a.Bounds.X - 1, a.Bounds.Y - 1, a.Bounds.Size.Width, a.Bounds.Size.Height); }; }