Add highdpi text/control setting, detect dark

Detects for system dark mode on startup since many users don't know about dark mode. Won't override any existing setting, just detects if no cfg exists `new()`.

Text/control dpi scaling is opt-in for high dpi users, reduces font blurriness.
https://github.com/kwsch/PKHeX/discussions/4458#discussioncomment-12362513
The hover-preview was rewritten in the past year to directly paint instead of updating many controls, so it works fine with `DpiUnawareGdiScaled`. I've not checked extensively to see if anything becomes broken, so user beware 💫
This commit is contained in:
Kurt
2026-05-27 11:28:16 -05:00
parent 3c6c7d71c2
commit dd76abdbb4
2 changed files with 7 additions and 1 deletions

View File

@@ -39,6 +39,8 @@ static Program()
if (Settings.Startup.DarkMode)
Application.SetColorMode(SystemColorMode.Dark);
if (Settings.Startup.HighDpiText)
Application.SetHighDpiMode(HighDpiMode.DpiUnawareGdiScaled);
}
[STAThread]

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms;
@@ -12,11 +13,14 @@ public sealed class StartupSettings : IStartupSettings
public string Version { get; set; } = string.Empty;
[LocalizedDescription("Use the Dark color mode for the application on startup.")]
public bool DarkMode { get; set; }
public bool DarkMode { get; set; } = Application.SystemColorMode == SystemColorMode.Dark; // auto-detect for new settings, json load preserves any choice.
[LocalizedDescription("Force HaX mode on Program Launch")]
public bool ForceHaXOnLaunch { get; set; }
[LocalizedDescription("Toggles a higher Dpi rendering mode for the application on startup.")]
public bool HighDpiText { get; set; } // opt-in
[LocalizedDescription("Skips displaying the splash screen on Program Launch.")]
public bool SkipSplashScreen { get; set; }