From d2e8d722e771a53241ad35aa28762e565cba6d1a Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 10 May 2024 23:17:22 -0500 Subject: [PATCH] Add setting for pkmeditor selected tab colors --- .../Controls/PKM Editor/DrawConfig.cs | 23 +++++-------------- .../Controls/PKM Editor/VerticalTabControl.cs | 4 +++- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/DrawConfig.cs b/PKHeX.WinForms/Controls/PKM Editor/DrawConfig.cs index 673cfdf4a..daf184f8f 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/DrawConfig.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/DrawConfig.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Drawing; @@ -23,6 +22,12 @@ public sealed class DrawConfig : IDisposable [Category(Hovering), LocalizedDescription("Hovering over a PKM color 2.")] public Color GlowFinal { get; set; } = Color.LightSkyBlue; + [Category(PKM), LocalizedDescription("Vertical tab selected primary color.")] + public Color VerticalSelectPrimary { get; set; } = Color.White; + + [Category(PKM), LocalizedDescription("Vertical tab selected secondary color.")] + public Color VerticalSelectSecondary { get; set; } = Color.LightGray; + #region PKM [Category(PKM), LocalizedDescription("Background color of a ComboBox when the selected item is not valid.")] @@ -105,22 +110,6 @@ public void LoadBrushes() } public void Dispose() => Brushes.Dispose(); - - public override string ToString() - { - var props = ReflectUtil.GetAllPropertyInfoCanWritePublic(typeof(DrawConfig)); - var lines = new List(); - foreach (var p in props) - { - if (p.PropertyType == typeof(BrushSet)) - continue; - - var name = p.Name; - var value = p.PropertyType == typeof(Color) ? ((Color)p.GetValue(this)!).ToArgb() : p.GetValue(this); - lines.Add($"{name}\t{value}"); - } - return string.Join("\n", lines); - } } public sealed class BrushSet : IDisposable diff --git a/PKHeX.WinForms/Controls/PKM Editor/VerticalTabControl.cs b/PKHeX.WinForms/Controls/PKM Editor/VerticalTabControl.cs index 5e785d048..7bc0f4ead 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/VerticalTabControl.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/VerticalTabControl.cs @@ -78,7 +78,9 @@ protected override void OnDrawItem(DrawItemEventArgs e) var graphics = e.Graphics; if (e.State == DrawItemState.Selected) { - using var brush = new LinearGradientBrush(bounds, Color.White, Color.LightGray, 90f); + var settings = Main.Settings.Draw; + var (c1, c2) = (settings.VerticalSelectPrimary, settings.VerticalSelectSecondary); + using var brush = new LinearGradientBrush(bounds, c1, c2, 90f); graphics.FillRectangle(brush, bounds); using var pipBrush = new SolidBrush(SelectedTags[index]);