Add focus border setting

Can set to -1 to remove it
This commit is contained in:
Kurt
2023-02-06 18:11:30 -08:00
parent 376e8f2d4f
commit 3871b2f316
5 changed files with 24 additions and 17 deletions

View File

@@ -18,55 +18,55 @@ public sealed class DrawConfig : IDisposable
private const string Moves = "Moves";
private const string Hovering = "Hovering";
[Category(Hovering), Description("Hovering over a PKM color 1.")]
[Category(Hovering), LocalizedDescription("Hovering over a PKM color 1.")]
public Color GlowInitial { get; set; } = Color.White;
[Category(Hovering), Description("Hovering over a PKM color 2.")]
[Category(Hovering), LocalizedDescription("Hovering over a PKM color 2.")]
public Color GlowFinal { get; set; } = Color.LightSkyBlue;
#region PKM
[Category(PKM), Description("Background color of a ComboBox when the selected item is not valid.")]
[Category(PKM), LocalizedDescription("Background color of a ComboBox when the selected item is not valid.")]
public Color InvalidSelection { get; set; } = Color.DarkSalmon;
[Category(PKM), Description("Default colored marking.")]
[Category(PKM), LocalizedDescription("Default colored marking.")]
public Color MarkDefault { get; set; } = Color.Black;
[Category(PKM), Description("Blue colored marking.")]
[Category(PKM), LocalizedDescription("Blue colored marking.")]
public Color MarkBlue { get; set; } = Color.FromArgb(000, 191, 255);
[Category(PKM), Description("Pink colored marking.")]
[Category(PKM), LocalizedDescription("Pink colored marking.")]
public Color MarkPink { get; set; } = Color.FromArgb(255, 117, 179);
[Category(PKM), Description("Male gender color.")]
[Category(PKM), LocalizedDescription("Male gender color.")]
public Color Male { get; set; } = Color.Blue;
[Category(PKM), Description("Female gender color.")]
[Category(PKM), LocalizedDescription("Female gender color.")]
public Color Female { get; set; } = Color.Red;
[Category(PKM), Description("Shiny star when using unicode characters.")]
[Category(PKM), LocalizedDescription("Shiny star when using unicode characters.")]
public string ShinyUnicode { get; set; } = "☆";
[Category(PKM), Description("Shiny star when not using unicode characters.")]
[Category(PKM), LocalizedDescription("Shiny star when not using unicode characters.")]
public string ShinyDefault { get; set; } = "*";
#endregion
#region Moves
[Category(Moves), Description("Legal move choice background color.")]
[Category(Moves), LocalizedDescription("Legal move choice background color.")]
public Color BackLegal { get; set; } = Color.FromArgb(200, 255, 200);
[Category(Moves), Description("Legal move choice text color.")]
[Category(Moves), LocalizedDescription("Legal move choice text color.")]
public Color TextColor { get; set; } = SystemColors.WindowText;
[Category(Moves), Description("Illegal Legal move choice background color.")]
[Category(Moves), LocalizedDescription("Illegal Legal move choice background color.")]
public Color BackColor { get; set; } = SystemColors.Window;
[Category(Moves), Description("Highlighted move choice background color.")]
[Category(Moves), LocalizedDescription("Highlighted move choice background color.")]
public Color BackHighlighted { get; set; } = SystemColors.Highlight;
[Category(Moves), Description("Highlighted move choice text color.")]
[Category(Moves), LocalizedDescription("Highlighted move choice text color.")]
public Color TextHighlighted { get; set; } = SystemColors.HighlightText;
#endregion

View File

@@ -12,6 +12,7 @@ public partial class GenderToggle : UserControl, IGenderToggle
private int Value = -1; // Initial load will trigger gender to appear (-1 => 0)
private string? InitialAccessible;
public static int FocusBorderDeflate { get; set; }
public int Gender
{
@@ -47,7 +48,7 @@ protected override void OnPaint(PaintEventArgs pe)
if (!Focused)
return;
var rc = ClientRectangle;
rc.Inflate(-2, -2);
rc.Inflate(-FocusBorderDeflate, -FocusBorderDeflate);
ControlPaint.DrawFocusRectangle(pe.Graphics, rc);
}

View File

@@ -8,6 +8,8 @@ public class SelectablePictureBox : PictureBox
{
public SelectablePictureBox() => SetStyle(ControlStyles.Selectable, TabStop = true);
public static int FocusBorderDeflate { get; set; }
protected override void OnMouseDown(MouseEventArgs e)
{
Focus();
@@ -31,7 +33,7 @@ protected override void OnPaint(PaintEventArgs pe)
if (!Focused)
return;
var rc = ClientRectangle;
rc.Inflate(-2, -2);
rc.Inflate(-FocusBorderDeflate, -FocusBorderDeflate);
ControlPaint.DrawFocusRectangle(pe.Graphics, rc);
}
}

View File

@@ -419,6 +419,7 @@ private void ReloadProgramSettings(PKHeXSettings settings)
EntityConverter.AllowIncompatibleConversion = settings.Advanced.AllowIncompatibleConversion;
EntityConverter.RejuvenateHOME = settings.Advanced.AllowGuessRejuvenateHOME;
WinFormsUtil.DetectSaveFileOnFileOpen = settings.Startup.TryDetectRecentSave;
SelectablePictureBox.FocusBorderDeflate = GenderToggle.FocusBorderDeflate = settings.Display.FocusBorderDeflate;
SpriteBuilder.LoadSettings(settings.Sprite);
}

View File

@@ -369,6 +369,9 @@ public sealed class DisplaySettings
[LocalizedDescription("Flag Illegal Slots in Save File")]
public bool FlagIllegal { get; set; } = true;
[LocalizedDescription("Focus border indentation for custom drawn image controls.")]
public int FocusBorderDeflate { get; set; } = 1;
}
[Serializable]