Add setting for pkmeditor selected tab colors

This commit is contained in:
Kurt 2024-05-10 23:17:22 -05:00
parent 410be93358
commit d2e8d722e7
2 changed files with 9 additions and 18 deletions

View file

@ -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 sealed class DrawConfig : IDisposable
}
public void Dispose() => Brushes.Dispose();
public override string ToString()
{
var props = ReflectUtil.GetAllPropertyInfoCanWritePublic(typeof(DrawConfig));
var lines = new List<string>();
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

View file

@ -78,7 +78,9 @@ public sealed class VerticalTabControlEntityEditor : VerticalTabControl
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]);